?

Log in

No account? Create an account
 

Scaling parameter...

About  

Previous Entry Scaling parameter... Dec. 31st, 2005 @ 11:05 am Next Entry
Is there a defined list of allowed scaling parameters?

For example:
http://pics.livejournal.com/thelovebug/pic/0003kgqh/s100x100 works
http://pics.livejournal.com/thelovebug/pic/0003kgqh/s320x320 does too

However:
http://pics.livejournal.com/thelovebug/pic/0003kgqh/s400x400 does not
http://pics.livejournal.com/thelovebug/pic/0003kgqh/s400x300 neither

So what is allowed, and what is not?

Cheers!
Leave a comment
[User Picture Icon]
From:lyosh108
Date:January 1st, 2006 09:01 am (UTC)
(Link)
donno about the list, but i checked this a while ago, so:

s100x100, s320x320, s640x480, s800x600, s1024x768
[User Picture Icon]
From:thelovebug
Date:January 1st, 2006 10:14 am (UTC)
(Link)
Thanks for that.

I was looking for something along the lines of s400x400 or s480x480, which don't appear to exist. I've search the source code, and nothing is given away there.
[User Picture Icon]
From:thelovebug
Date:January 1st, 2006 10:18 am (UTC)
(Link)
Scrap that, I just found this in the source...

@FB::VALID_SCALING_W = qw(0 50 100 150 320 640 800 1024 1280 1600);
@FB::VALID_SCALING_H = qw(0 50 100 150 240 320 480 600 640 768 960 1200);

So if sAAAxBBB, AAA can be anything from the top row, and BBB anything from the bottom.
[User Picture Icon]
From:whitaker
Date:January 4th, 2006 03:03 am (UTC)
(Link)
So if sAAAxBBB, AAA can be anything from the top row, and BBB anything from the bottom.

Yep, that's right. And aspect ration must also be maintained for the dimensions to be valid. The following functions might be useful to look over if you're interested: (lib/fotobilder.pl)

FB::valid_scaling_list
FB::valid_scaling
FB::scale

(Leave a comment)
Top of Page Powered by LiveJournal.com