Announcement

#1 2013-05-04 16:02:42

tapan
Member
2013-05-04
14

Resize on Server

I would like to know if there is a way I can resize images already uploaded to the server/website?

Version 2.5.1

Offline

 

#2 2013-05-04 18:01:30

pewe
Member
2012-03-16
439

Re: Resize on Server

Hi Tapan

Can you be a bit more explicit about what it is you want to do.
Are you looking:

- for the ability to resize the original images in a virtual directory after upload
- for the ability to resize the original images in a physical directory after upload
- to change the size of the images displayed on the web site.

If it is the latter, this can be done by going into the admin panel and go to 'configuration->options->photo sizes' and change the sizes for each size chosen to display by selecting the 'show details' option on the left of this page.

If you are looking to change the sizes of the original uploaded images this is more complicated and will require a custom script to do it.

Offline

 

#3 2013-05-04 21:02:18

tapan
Member
2013-05-04
14

Re: Resize on Server

Hi pewe,
I am looking for the ability to "resize the original images in a physical directory after upload".

I have used the option / settings that you have mentioned but that will apply to files that i upload from now on.

I need to reduce the file sizes on the server.

Offline

 

#4 2013-05-05 00:21:04

pewe
Member
2012-03-16
439

Re: Resize on Server

I assume you want to resize the photos on the server to save re-uploading them.
Is that the case?

I assume as they are 'physical' that you have are using ftp?

Do you have access to a 'file manager' on the server using an admin panel?

Offline

 

#5 2013-05-06 09:08:59

tapan
Member
2013-05-04
14

Re: Resize on Server

That is correct, I don't want to reupload them.  I do have access to FTP and the File Manager through the control panel.

Tapan

Offline

 

#6 2013-05-06 12:29:47

pewe
Member
2012-03-16
439

Re: Resize on Server

OK.

This is how my script works.

You edit the script to specify the new size of all the images you are seeking to alter.
IE in the script there is a variable which you set to 0.5 if you want the images to be halved, 0.75 for 3/4 of size etc.

You place the script in the same directory as the photos you want to resize. For example you may have 5 directories which are albums, one containing a sub-directory which is a sub-album in which case so you would place a copy of the script in the 6 directories, then run each copy separately by using a url which directly links to the script.
The script alters the stored image

The script returns a message listing all the photos in that directory with its new size.

IMPORTANT NOTE:
- After resizing you need to run a 'Metadata Sync' in 'Batch Manager' for each album altered to correct the sizes which are stored in the database and displayed in the info panels.
- Resizing with PHP will remove all information (EXIF,IPTC etc) from the image.
- As the script changes the ACTUAL photos, make sure you take a backup copy of them using your CPanel File Manager to copy to a backup directory before running the script. You can delete the backups once completed.

If you would like a copy of the script, send me a pm with your e-mail address and I'll e-mail it to you as a zip file (its only 1kb in size).

Last edited by pewe (2013-05-06 12:37:44)

Offline

 

#7 2013-05-07 05:59:35

tapan
Member
2013-05-04
14

Re: Resize on Server

Hi Pewe,
   I have sent you a PM on this.

Regards.,
Tapan

Offline

 

#8 2013-05-07 13:15:11

pewe
Member
2012-03-16
439

Re: Resize on Server

Sent e-mail.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact