Failed to show images with "set fileName"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Failed to show images with "set fileName"
When I set the "fileName" of my image, I get "could not open image".
There is nothing wrong with the pathway, this seems to be a similar issue to my previous problem, to delete a file that it I resolved by closing the file before I try to delete it.
http://forums.livecode.com/viewtopic.php?f=18&t=30304
if I copy the pathway and then set the property inspector for the image to it, nothing happens. This applies to all images that I somehow handle in the application.
For example, if I set the pathway to a desktop image before I use it in the application, it works. However, after the program has copied it, it will not work.
Suggestions, anyone?
///Peter
There is nothing wrong with the pathway, this seems to be a similar issue to my previous problem, to delete a file that it I resolved by closing the file before I try to delete it.
http://forums.livecode.com/viewtopic.php?f=18&t=30304
if I copy the pathway and then set the property inspector for the image to it, nothing happens. This applies to all images that I somehow handle in the application.
For example, if I set the pathway to a desktop image before I use it in the application, it works. However, after the program has copied it, it will not work.
Suggestions, anyone?
///Peter
/*Whats all the fuss with c# ?*/
Re: Failed to show images with "set fileName"
Hi Peter,
what did you script to set "the filename"?
Best
Klaus
what did you script to set "the filename"?
Best
Klaus
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
Hi Klaus,
The fastest respons ever, I think.
put the defaultFolder into tFolder
repeat with x = 1 to the number of lines in theImage
if x = 7
then
answer "You can't save more than six images !"
exit repeat
end if
put line x of theImage into myImage
put tFolder & "/" & myImage into tImagePath
set the filename of image ("image" & x) to tImagePath
end repeat
And the script works, the image get the pathway and it's correct, but the images won't show for some reason.
///peter
The fastest respons ever, I think.
put the defaultFolder into tFolder
repeat with x = 1 to the number of lines in theImage
if x = 7
then
answer "You can't save more than six images !"
exit repeat
end if
put line x of theImage into myImage
put tFolder & "/" & myImage into tImagePath
set the filename of image ("image" & x) to tImagePath
end repeat
And the script works, the image get the pathway and it's correct, but the images won't show for some reason.
///peter
/*Whats all the fuss with c# ?*/
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Failed to show images with "set fileName"
This worked for me (LC 7.1.4, Mac OS 10.7.5)
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
I've forgotten to say that there is no problem on Mac, It's when I try to run my application on windows that it fails.
/*Whats all the fuss with c# ?*/
Re: Failed to show images with "set fileName"
The script looks OK, but be sure to doublecheck that THE DEFAULTFOLDER is really set to the folder you need here! You were setting this a couple of times in the other thread, so better check it.
Re: Failed to show images with "set fileName"
What Klaus said, and this may also be an area where you would want to put in a custom property to store the path instead of default folder, as then you would be always sure it is correct.
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
If I check the property of the image after I've run my script I can see that the pathway is correct. If I copy / paste that into the explorer the image pops up on the screen.
/*Whats all the fuss with c# ?*/
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
Bogs,
I've actually use custom property to store my pathways, I just tried to set the default folder to it after I've run into all of this problems.
///Peter
I've actually use custom property to store my pathways, I just tried to set the default folder to it after I've run into all of this problems.
///Peter
/*Whats all the fuss with c# ?*/
Re: Failed to show images with "set fileName"
Is that a relative or absolute pathname? How dou you set it? And to what?
If something works on a Mac but not on Windows like here, it is a pathname problem mot of the time.
If something works on a Mac but not on Windows like here, it is a pathname problem mot of the time.
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
It's an absolute pathname.
C:/Users/UserName/AppData/Local/Temp/Cell-Images/fileName
C:/Users/UserName/AppData/Local/Temp/Cell-Images/fileName
/*Whats all the fuss with c# ?*/
Re: Failed to show images with "set fileName"
And you store it like:
...
set the whatever of wherever to specialfolderpath("temporary") & "/Cell-Images/"
...
right?
...
set the whatever of wherever to specialfolderpath("temporary") & "/Cell-Images/"
...
right?
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
Hmmmm....?
Did you try (just to be sure):
Did you try (just to be sure):
Code: Select all
...
put line x of theImage into myImage
put tFolder & "/" & myImage into tImagePath
answer (there is a file tImagePath)
## Should be TRUE of course
set the filename of image ("image" & x) to tImagePath
end repeat
...
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Failed to show images with "set fileName"
Now I have!
I got False, but the file is there.!? (Yes I can see it)
I've also got the result "could not open image"
But the path of the image is set to the right path, and the same path works just fine in the explorer...
I am really REALLY confused!
Klaus,
Is there anyway I can persuade you to take a look at my stack to see if you can locate the problem?
///Peter
I got False, but the file is there.!? (Yes I can see it)
I've also got the result "could not open image"
But the path of the image is set to the right path, and the same path works just fine in the explorer...
I am really REALLY confused!
Klaus,
Is there anyway I can persuade you to take a look at my stack to see if you can locate the problem?
///Peter
/*Whats all the fuss with c# ?*/