librelist archives

« back to archive

Image scaling

Image scaling

From:
Roald
Date:
2013-07-12 @ 19:01
Hey, guys!
I'm building an app that allows me to preview images using shoes. 
Slideshow app of sorts. However, the images are returned in their full 
size and are cropped if it is bigger than the app or the stack.
Can I scale the images to specific size? Namely to fit the size of the 
stack?
I looked at the image( ) entry in the documentation but couldn't find 
anything relevant.

Do I have to use a thumbnailing utility? I really don't want to!
Thanks,
Roald

Re: [shoes] Image scaling

From:
Kc Erb
Date:
2013-07-12 @ 19:17
Roald,

Take a look at this for an idea:

http://pastebin.com/TbTNW50c

Shoes does scaling via the width: and height: options. You have to be
careful because your image could get skewed. I have written a little case
statement which I give the maximum dimensions of the image (in the example
I needed 300 x 230) and then it gets scaled correctly to fit into the size
I want regardless of its original size.

Disclaimer: I am pretty new to Shoes myself, I'm throwing this out there to
both help and be helped. If my code can be improved please tell me


-KC


On Fri, Jul 12, 2013 at 1:01 PM, Roald <roalddino@gmail.com> wrote:

> Hey, guys!
> I'm building an app that allows me to preview images using shoes.
> Slideshow app of sorts. However, the images are returned in their full
> size and are cropped if it is bigger than the app or the stack.
> Can I scale the images to specific size? Namely to fit the size of the
> stack?
> I looked at the image( ) entry in the documentation but couldn't find
> anything relevant.
>
> Do I have to use a thumbnailing utility? I really don't want to!
> Thanks,
> Roald
>



-- 
 "If there is an exception to every rule, then every rule must have at
least one exception; the exception to this one being that it has no
exception."