Trouble importing image
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Trouble importing image
I created an import button on card 1 of a window with the script:
on mouseup
answer file "Select jpeg file"
put there is a file it into Isfilethere
put Isfilethere
import paint from file it
end mouseup
Isfilethere comes back as true, but no image file is imported. I have tried this on images with .png and .jpg extensions and no go.
Any help would be appreciated! Thanks!
on mouseup
answer file "Select jpeg file"
put there is a file it into Isfilethere
put Isfilethere
import paint from file it
end mouseup
Isfilethere comes back as true, but no image file is imported. I have tried this on images with .png and .jpg extensions and no go.
Any help would be appreciated! Thanks!
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Trouble importing image
Hi David,
I tried your script with LC 6.7.0 and it works for me
Which version of liveCode you use ?
Best regards
Jean-Marc
I tried your script with LC 6.7.0 and it works for me
Which version of liveCode you use ?
Best regards
Jean-Marc
https://alternatic.ch
Re: Trouble importing image
Livecode 7.00 with OS X Yosemite 10.3.3.
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Trouble importing image
It's almost always helpful to check "the result" after any command that may have errors. Those involving disk I/O can often benefit from checking sysError() as well, as that will return any OS error code if something went wrong.
So in your case, right after your import command add this:
So in your case, right after your import command add this:
Code: Select all
if the result is not empty then
answer "An error occured: "& the result &"("& sysError() &")"
end if
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Trouble importing image
Well, the result was empty. Nothing came up with your script, Richard. But I did learn that
it's the operating system: the import worked just fine on a MacBook Pro running 10.8.5. It
just does not work on 10.10.3 ("Yosemite"). Hopefully the next Livecode update will fix it.
Thanks,
Dave
it's the operating system: the import worked just fine on a MacBook Pro running 10.8.5. It
just does not work on 10.10.3 ("Yosemite"). Hopefully the next Livecode update will fix it.
Thanks,
Dave
Re: Trouble importing image
Ok, Murphy was just having his way with me. Believe it or not, I went back to the stack on Yosemite
(and this is the same file, mind, because it's syncing via Dropbox) and now it's importing. I did not
touch the script, it is the exact script that did not work before and now, since I guess it got "permission"
when it worked on OSX 10.8.5, decided to join the land of the living scripts. Go figure...
(and this is the same file, mind, because it's syncing via Dropbox) and now it's importing. I did not
touch the script, it is the exact script that did not work before and now, since I guess it got "permission"
when it worked on OSX 10.8.5, decided to join the land of the living scripts. Go figure...