Announcement

#1 2011-08-17 11:48:22

Sten
Member
2011-08-17
5

resizing HD-image

Hey, thanks for a nice simple gallery software, I wonder if it is possible to compress or resize the HD version by default when it is uploaded. I'm using Piwigo 2.2.4 and I did find the functions_upload.inc.php with the following lines.

Code:

'hd_keep' => array(
      'default' => true,
      'can_be_null' => false,
      ),
  
    'hd_resize' => array(
      'default' => false,
      'can_be_null' => false,
      ),
  
    'hd_maxwidth' => array(
      'default' => 2000,
      'min' => 500,
      'max' => 20000,
      'pattern' => '/^\d+$/',
      'can_be_null' => false,
      'error_message' => l10n('The high definition maximum width must be a number between %d and %d'),
      ),
  
    'hd_maxheight' => array(
      'default' => 2000,
      'min' => 500,
      'max' => 20000,
      'pattern' => '/^\d+$/',
      'can_be_null' => false,
      'error_message' => l10n('The high definition maximum height must be a number between %d and %d'),
      ),
  
    'hd_quality' => array(
      'default' => 95,
      'min' => 50,
      'max' => 100,
      'pattern' => '/^\d+$/',
      'can_be_null' => false,
      'error_message' => l10n('The high definition image quality must be a number between %d and %d'),
      ),
    );

The problem is that however I change these lines they don't seem to do anything different att all. My HD images are always kept on the server and they are not resized at all.

I'm not able to find any options to configure this when I log in to the admin section in Piwigo either.

Any ideas on how I can change these values? My host only allows ftp and mysql access, so I can't change anything on the server side. If it is not possible for me to change these values I wonder if it is possible to only allow uploads with a maximum filesize forcing my users to resize the images themselves, although I would prefer if they could be resized by the server when uploading.

There reason I want to resize the HD-images is because I want to conserve storagespace on the server and I know many of my friends use good DSLR cameras making each image 2-6MB and 3000+ pixels wide.

All help I can get would be much appreciated!

EDIT: I just got a reply from my host telling me that imagemagick is not installed on the server, so I suppose that is why it is not working.

Last edited by Sten (2011-08-17 11:52:10)

Offline

 

#2 2011-08-17 11:52:30

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: resizing HD-image

Hi Sten,

The HD resize options are available only if Piwigo finds ImageMagick as a replacement of GD : this is the technical library that resize photos on the server. If you don't see the HD resize options on screen [Administration > Photos > Add > Settings], it means you're running GD.

Try [extension by P@t] External ImageMagick and see if these options are available.

Offline

 

#3 2011-08-17 11:54:02

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: resizing HD-image

Sten wrote:

EDIT: I just got a reply from my host telling me that imagemagick is not installed on the server, so I suppose that is why it is not working.

Don't ever edit a message to add information :-) You never know when your message will be read. If you want to add information, add a new message.

Indeed, it's the problem, you need ImageMagick to perform HD resize.

Offline

 

#4 2011-08-17 11:56:14

Sten
Member
2011-08-17
5

Re: resizing HD-image

plg wrote:

Hi Sten,

The HD resize options are available only if Piwigo finds ImageMagick as a replacement of GD : this is the technical library that resize photos on the server. If you don't see the HD resize options on screen [Administration > Photos > Add > Settings], it means you're running GD.

Try [extension by P@t] External ImageMagick and see if these options are available.

Thanks, yes I did just get an answer from my host that ImageMagick is not installed on the server. And the ImageMagick plugin is giving me the following message.

Unable to locate ImageMagick directory. Please fill $conf['imagick_directory'] in your local configuration file.

Is it possible that I could make this work with only GD?

Offline

 

#5 2011-08-17 12:05:55

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: resizing HD-image

The problem with GD is that it removes all EXIF/IPTC metadata in the resized picture.

If you don't care about EXIF/IPTC, then here is a hack (will be lost when you upgrade Piwigo). Open file admin/include/functions_upload.inc.php, line 819, replace:

Code:

function is_imagick()
{

by


Code:

function is_imagick()
{
  return true;

Offline

 

#6 2011-08-17 12:10:52

Sten
Member
2011-08-17
5

Re: resizing HD-image

Okay, yes I realized later I shouldn't have edited the message since you answered before my edit was complete. Exif data is nice, but I can live without it if it allows me to resize the images.

I will try your hack and report back. =)

Offline

 

#7 2011-08-17 12:40:59

Sten
Member
2011-08-17
5

Re: resizing HD-image

In one way the hack did work since it allowed me to change the resize settings for HD images, but it broke the upload function so that no image will be uploaded at all, my guess is that my Piwigo install now believe that imagemagick is installed although it isn't, which results in it trying to use the imagemagick functions when uploading instead of GD.

Offline

 

#8 2011-08-17 12:57:58

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: resizing HD-image

Yes, you're right, you need to hack admin/include/functions_upload.inc.php much more :-/

Offline

 

#9 2011-08-17 13:19:33

Sten
Member
2011-08-17
5

Re: resizing HD-image

I will take a look at it some day when I have more time, thanks for the help! I will probably be back with a few more questions.

Offline

 

#10 2011-08-22 11:14:29

Jeroen
Guest

Re: resizing HD-image

It would be great if we could also resize the original pictures with GD2. No ImageMagick on my server, to bad...

 

#11 2011-08-24 11:19:03

JeroenVdb
Member
2011-08-24
6

Re: resizing HD-image

My server administrator activated ImageMagick and now it works!

Offline

 

#12 2011-12-22 23:03:50

Garcia
Translation Team
Third world...
1970-01-01
48

Re: resizing HD-image

Hi ...
I have so many HD pictures , But I don't want to resize 'em completely !!!
How can I resize 'em ... But also give users a direct link for full resolution picture ???


I Hate Myself... :)

Offline

 

Board footer

Powered by FluxBB

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