Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Parameters used for resize (crop) in pic_editor  (Read 2390 times)

0 Members and 1 Guest are viewing this topic.

André Müller

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
Parameters used for resize (crop) in pic_editor
« on: October 18, 2013, 03:46:26 pm »

Dear all,

I came across another (possibly unintended) behaviour of the CPG.
For my gallery I set the dimensions of all thumbs to identical portrait dimensions to have a clean look. This, however, makes it necessary to fine tune the focus point of some of the thumbs. This can be done by two ways: Usage of the Plugin for a custom thumb (http://forum.coppermine-gallery.net/index.php/topic,60272.0.html), or by the use of the pic_editor -> save as thumb.
Using the plugin, the uploaded file is centrally cropped to fit the set dimensions (as expected!).
Using the pic_editor, I can manually crop the image and than "save as thumbnail". Here the image is not cropped and only the width of the set thumbnail is used. The height is set proportional to the original aspect ratio. This is something I haven't expected! (As far as my php-knowledge reaches, plugin and pic_editor use the same code to crop.
Additionally, both (plugin and pic_editor) use (at least partially) the dimensions set for thumbnails, but apparently not the sharpness settings (see below).

Is it possible to implement either a fixed aspect ratio cropping box, or an improved cropping algorithm in the pic_editor and use similar sharpness settings as used for the out of the box thumbnail? Ditto for the custom thumb plugin.

Pleas see http://www.fotowald.de/thumbnails-115.html PW: "test" (also attached as screenshot!)
The files show the originally created thumb "original",
an intentionally portrait cropped created thumb with the pic_editor "cropped",
a thumb created using the custom thumb plugin (using a similar portrait crop as used for the thumb before) "custom thumb"
and finally the file I uploaded via the plugin with a out of the box thumb.

Please not the different sharpness of the thumbs created straight away and created additionally and also note the distorted thumb when created using the pic_editor.

Thanks a lot,
André

Logged

André Müller

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
Re: Parameters used for resize (crop) in pic_editor
« Reply #1 on: October 18, 2013, 03:49:31 pm »

The first "portrait" should have read "landscape"

Also I forgot to mention my sharpness settings: 120% radius 0.5, threshold 3

Cheers.
Logged

André Müller

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
Re: Parameters used for resize (crop) in pic_editor
« Reply #2 on: October 26, 2013, 09:08:30 pm »

Dear all,

I solved the issue with the plugin. Changing in l 70

Code: [Select]
                    resize_image($thumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
with
Code: [Select]
                    resize_image($thumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false", 1);
switches the sharpening on.
However, my preferred and much easier solution would be via the function in pic_editor. Here the thumbnail is not created by the resize_image function defined in include/picmgmt.inc.php, but via resizeImage directly. Is there an easy way to change that, so that the same function as above is used (including the correct cropping and sharpening?)

Cheers,
André
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Parameters used for resize (crop) in pic_editor
« Reply #3 on: October 30, 2013, 01:24:16 pm »

Is there an easy way to change that, so that the same function as above is used (including the correct cropping and sharpening?)
Please reply to this thread so I can check that later.

Regarding the pic editor, I also like the idea of a fixed ratio box. Unfortunately the pic editor is also used to crop the bigger sized pictures, so we need to display that box just if the user decides to update the thumbnail.
Logged

André Müller

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
Re: Re: Parameters used for resize (crop) in pic_editor
« Reply #4 on: October 30, 2013, 04:18:03 pm »

Please reply to this thread so I can check that later.

Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.