Parameters used for resize (crop) in pic_editor Parameters used for resize (crop) in pic_editor
 

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

Main Menu

Parameters used for resize (crop) in pic_editor

Started by André Müller, October 18, 2013, 03:46:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

André Müller

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é


André Müller

The first "portrait" should have read "landscape"

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

Cheers.

André Müller

Dear all,

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

                    resize_image($thumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);

with
                    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é

Αndré

Quote from: André Müller on October 26, 2013, 09:08:30 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.

André Müller