Page 1 of 1

Modify upload dimension of images

Posted: Thu Dec 15, 2005 12:45 pm
by jojje
Is it possible to change the upload size of a picture when it´s uploaded?
What file shall I look in?

Now it´s just possible to adjust the size of the thumbnails but I think it would be good to be able to adjust the siza of the uploaded "fullsize" picture as well.

Re: Modify upload size of image

Posted: Thu Dec 15, 2005 1:09 pm
by garvinhicking
What exactly do you want?

Do you want to only allow to upload images smaller than 1 Megabyte?

Or do you want to make files larger than 1 Megabyte to be smaller than 1 megabyte? IF you want this, this cannot be done easily. There is no way to calculate the required dimensions of a file so that it is no larger than X MB. Even photoshop can't do that. :-)

Regards,
Garvin

Posted: Thu Dec 15, 2005 2:00 pm
by MySchizoBuddy
i think he is talking about the dimensions. Automatically resize large images to have max of 500px width or height.

Posted: Thu Dec 15, 2005 2:06 pm
by garvinhicking
Ah, okay. Well, I for one usually suggest and prefer that people resize their original images themselves. Resizing with imagemagick or gdlib is always a loss in quality, and resizing is much bader there as when you use a photoshop/gimp tool...

Best regards,
Garvin

Posted: Thu Dec 15, 2005 2:15 pm
by jojje
Yes it´s about the dimension I asking.

I think I can live with the quality loss. The people that is going to use the blogg are not so used to use computers so I want to keep it as simple as possible.

What file is it that handles the upload of pictures and resizing of the thumbnail?

Posted: Thu Dec 15, 2005 10:08 pm
by garvinhicking
You should be able to do that with a plugin and using a recent serendipity 1.0-alpha1, where some new hooks have been added just this week.

The files you may want to look at are include/admin/images.inc.php and include/functions_images.inc.php.

Regards,
Garvin