Modify upload dimension of images

Creating and modifying plugins.
Post Reply
jojje
Regular
Posts: 41
Joined: Thu Dec 08, 2005 4:09 pm
Location: Sweden
Contact:

Modify upload dimension of images

Post 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.
Last edited by jojje on Thu Dec 15, 2005 2:16 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Modify upload size of image

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

i think he is talking about the dimensions. Automatically resize large images to have max of 500px width or height.
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jojje
Regular
Posts: 41
Joined: Thu Dec 08, 2005 4:09 pm
Location: Sweden
Contact:

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply