Hi,
Just wondering if anyone has written code yet to export all the images from a stack before I re-invent the wheel
With retina working now, I just want to pull all the images from stacks so I can see what needs re-sizing or replacing, then put the larger images back in.
Thanks
Andy
Exporting all images from a stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Exporting all images from a stack
Hi Andy,
This isn't directly a response to your question but get this when you are ready;
http://livecodeshare.runrev.com/stack/7 ... dependence
Provides automatic scaled images with the correct file names
<image>@ultra-low.<ex> - 0.25x
<image>@extra-low.<ext> - 0.5x
<image>@low.<ext> - 0.75x
<image>@medium.<ext> / <image>.<ext> - 1x
<image>@high.<ext> - 1.5x
<image>@extra-high.<ext> / <image>@2x - 2x
<image>@ultra-high.<ext> - 4x
And I guess for the original question
repeat with x = 1 to the number of cd of this stack
repeat with y = 1 to the number of images of cd x
put the short name of img y of cd x into tName
put char -3 to -1 of tName into tExt
export image 1 to file tName as tExt
etc.
Simon
This isn't directly a response to your question but get this when you are ready;
http://livecodeshare.runrev.com/stack/7 ... dependence
Provides automatic scaled images with the correct file names
<image>@ultra-low.<ex> - 0.25x
<image>@extra-low.<ext> - 0.5x
<image>@low.<ext> - 0.75x
<image>@medium.<ext> / <image>.<ext> - 1x
<image>@high.<ext> - 1.5x
<image>@extra-high.<ext> / <image>@2x - 2x
<image>@ultra-high.<ext> - 4x
And I guess for the original question
repeat with x = 1 to the number of cd of this stack
repeat with y = 1 to the number of images of cd x
put the short name of img y of cd x into tName
put char -3 to -1 of tName into tExt
export image 1 to file tName as tExt
etc.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Exporting all images from a stack
Thanks Simon, I appreciate that.
Andy
Andy
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Exporting all images from a stack
I should have thought all you need is a couple of nested REPEAT statements
that chew their way through all the images on all the cards.
Have a go with the attachment
This stack has only one card with 5 images: but as a proof of concept it is just fine.
that chew their way through all the images on all the cards.
Have a go with the attachment
This stack has only one card with 5 images: but as a proof of concept it is just fine.
- Attachments
-
- img_exp.livecode.zip
- (37.57 KiB) Downloaded 447 times
Re: Exporting all images from a stack
Thanks,
Ive not been using livecode for a while due to an illness and am just getting back into it. Id just forgotten some of the commands, this really helps, thanks!
Ive not been using livecode for a while due to an illness and am just getting back into it. Id just forgotten some of the commands, this really helps, thanks!