jimmyjjames
Forum Replies Created
-
bugfix is now in implemented in the plugin (fixed in r789):
https://code.google.com/p/nextgen-gallery/issues/detail?id=308here the link to the issue and patch
https://code.google.com/p/nextgen-gallery/issues/detail?id=308hi thedrewseum,
i can’t reproduce the problem with the target thumbnail size of 80×100 pixels. have you checked the option “Set fix dimension”?
I have just committed a patch to googlecode for this problem. Hopefully it will be applied in the final version 1.6.0.
alekz
can u tell me the exact size of your photos, so i can test it?
Ok,
hi again. The last solution wasn’t right. I recognized it just now. But here is the final solution, and for me and the images i have it works.so again go to the wp-content\plugins\nextgen-gallery\admin\functions.php, line 272 and replace
if ($ngg->options['thumbfix']) { // check for portrait format if ($thumb->currentDimensions['height'] < $thumb->currentDimensions['width']) { // first resize to the wanted width $thumb->resize($ngg->options['thumbwidth'], 0); // get optimal y startpos $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2; $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } else { // first resize to the wanted height $thumb->resize(0, $ngg->options['thumbheight']); // get optimal x startpos $xpos = ($thumb->currentDimensions['width'] - $ngg->options['thumbwidth']) / 2; $thumb->crop($xpos, 0, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } //this create a thumbnail but keep ratio settings } else { $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']); }
with
if ($ngg->options['thumbfix']) { // check for portrait format $wratio = $ngg->options['thumbwidth'] / $thumb->currentDimensions['width']; $hratio = $ngg->options['thumbheight'] / $thumb->currentDimensions['height']; if ($wratio > $hratio) { // first resize to the wanted width $thumb->resize($ngg->options['thumbwidth'], 0); // get optimal y startpos $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2; $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } else { // first resize to the wanted height $thumb->resize(0, $ngg->options['thumbheight']); // get optimal x startpos $xpos = ($thumb->currentDimensions['width'] - $ngg->options['thumbwidth']) / 2; $thumb->crop($xpos, 0, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } //this create a thumbnail but keep ratio settings } else { $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']); }
i hope it works for you too, and it would be nice if this bugfix would be implemented in the original plugin, so we dont have to reimplement it everytime a new version of the plug in comes out.
cu,
jimmy aka alekzSorry for the late reply! Don’t we get mails, if a reply is sent on a thread in this forum?
yes i meant indeed the wp-content\plugins\nextgen-gallery\admin\functions.php file.
works it for you too?
jimmy
Hi,
so my solution is:
in the file functions.php in line 272 i replace
if ($ngg->options['thumbfix']) { // check for portrait format if ($thumb->currentDimensions['height'] < $thumb->currentDimensions['width']) { // first resize to the wanted width $thumb->resize($ngg->options['thumbwidth'], 0); // get optimal y startpos $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2; $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } else { // first resize to the wanted height $thumb->resize(0, $ngg->options['thumbheight']); // get optimal x startpos $xpos = ($thumb->currentDimensions['width'] - $ngg->options['thumbwidth']) / 2; $thumb->crop($xpos, 0, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); } //this create a thumbnail but keep ratio settings } else { $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']); }
with
if ($ngg->options['thumbfix']) { // check for portrait format // first resize to the wanted width $thumb->resize($ngg->options['thumbwidth'], 0); // get optimal y startpos $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2; $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']); //this create a thumbnail but keep ratio settings } else { $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']); }
and it seems to work.
maybe alex rabe could verify this und implement this bugfix into the plugin.
alekz
hi,
its me again.i looked into the source (lib/gd.thumbnail.inc.php). following things i have noticed:
1. the “resize” function is called, but perhaps “resizeFix” should be called!?
2. param $maxWidth is not set (but should be 150)
3. calcHeight function is called and calculates for the width proportionally the value 147 (instead the new imagesize should be calculated to 150×107 and afterwards be cropped to 150×105)can someone approve this false behaviour?
does someone know, why the param $maxWidth of the “resize”-function is not set?
is someone sure, if the “resize” or “resizeFix” function should be called.this excellent plug-in is unfortunately useless with this bug.
alekz