some kind of bug with imagemagick-resize

Found a bug? Tell us!!
Post Reply
bernd_d
Regular
Posts: 468
Joined: Thu Jun 03, 2010 9:28 am
Contact:

some kind of bug with imagemagick-resize

Post by bernd_d »

Until now i had a lot of problems if i include a lot of images and let them float. In some cases, the floating is broken and a lot of space was between the images, as you can see on following screenshot...
browser-diff.jpg
browser-diff.jpg (143.86 KiB) Viewed 2701 times
I asked yellowled about this (i thought it could be a 2k11-problem) and he told me it is because of wrong image-height of the portrait-format. Settings are on 200px height, but imagemagick resizes the thumbs sometimes to 199px because of the image-ratio. There seems to be rounding-differences within s9y to calculate the thumb-size/height/width.

To solve this problem, i included \! into the size-parameter of imagemagick as it is found on line 667 within /include/functions_images.inc.php

Code: Select all

$cmd     = escapeshellcmd($serendipity['convert']) . ' -antialias -resize '. serendipity_escapeshellarg($newSize) .'\! '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile);
After this (and rebuilding all thumbnails) you can see this difference between images/thumbs:
image-diff.png
image-diff.png (112.53 KiB) Viewed 2701 times
...and now, floating is working good, as you can see here :)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: some kind of bug with imagemagick-resize

Post by onli »

Thanks for the report. Feel like putting that in a real pull-request for the 2.0-branch, just for practice?
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: some kind of bug with imagemagick-resize

Post by onli »

Please have a look: https://github.com/s9y/Serendipity/comm ... e239171c1c (for the record: no, he didn't want to ;) )
Post Reply