Define Picture Size Limit Question

ryanh

Joined: 2005-01-27
Posts: 29
Posted: Fri, 2005-01-28 15:51

I have a question about the Album Properties, under Define Picture Size Limit.

I would like to place a 500kb maximum file size limit on the photos in my albums, mainly because I don't want the storage to get eaten up with large pics directly from +3MP cameras!

I've set this option to 500kb, however it is still letting the user upload an image larger than 500kb, and isn't resizing them. The owner of the album is 'family', and the user I'm doing this with is the same.

I guess what I'd like to have is something that will take an image that is larger than 500kb, and size it down until it's 500kb or less. Is this possible? Are there any hacks that would allow me to do this? Am I being greedy!? (maybe!)

Thanks for your input!
Ryan

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-01-28 16:23

The sizelimit module currently does not resize the image dimensions (Edit: when you specify only a max size in kb).. it tries its best to meet the requested limit by lowering jpeg quality or raising png compression level. If it puts jpeg quality all the way down to 5 then it keeps that.

Sounds like you'd like a new feature in this module to reduce the dimensions to meet the size limit you want... please file a feature request on sourceforge, thanks!

By the way, if you want to get this to work now you should enter values for both max dimensions and max filesize.. if you enter max dimensions of 1024x768 then it is more likely it will be able to achieve the 500k limit by lowering jpeg quality. Push the dimension limit down until it is able to get 500k on most/all images.....

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Fri, 2005-01-28 16:37

Sounds good, so from what I understand it'll allow a very large image to be uploaded and resize it itself. This is good, because there will be a lot of people that don't know the first thing about modifying images to be smaller.

Thanks for your help!

 
gillenm

Joined: 2005-04-24
Posts: 4
Posted: Tue, 2005-04-26 16:06

Hi,

I am having this same problem.

I am using the holy hand grenade release at the moment.

(http://cgi.sunim.plus.com/gallery2)

My album configuration is:

Resized Images:

[X] 400 x 600
[ ]
[ ]
[ ]

Picture Size Limit:

Maximum dimensions of full sized images

[ ] No Limits
[X] 400 x 600

Maximum file size of full sized images in kilobytes

[ ] No Limits
[X] 100

[ ] Keep original image?

I uploaded a picture to this album, the original picture size is:

960 x 1280 pixels.
203k

I used the upload applet without checking "resize before upload".

When I click on the photo it shows these size options:

400x533
960x1280
Full Size: 960x1280

The size of the file on the server is 203k.

I'd really like the 960x1280 (original) to be deleted for the sake of server space!

I have checked imagemagick and run tests on it, I have checked that the sizelimit
module is installed and active, I have captured debug during the upload but I can
see nothing in the debug about sizelimit, except for a "file exists" check.

Am I using it wrong?
Is it broken in the holy hand grenade release?
How can I help debug it?

Thanks,
Martin.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-04-26 16:52

GR / applet do not currently obey ItemAddOptions like sizelimit.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-04-26 19:45

mindless, why? I thought sizelimit would listen on entity->save events.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-04-26 21:13

no, it's an ItemAddOption.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-04-26 21:20

mindless, why not as entity->save listener? you can move the file on the filesystem around (temp dir) and then create the downsized versions? or would that be after derivates have been created?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-04-26 21:25

it would certainly work as an event listener, but that's a little bit of code that has to run on every save() operation to determine if it has work to do or not... ItemAddOption is a bit more targetted.. those are only loaded when adding items. but mainly, that's just the way it was written.