Closed (fixed)
Project:
ImageAPI
Version:
6.x-1.x-dev
Component:
ImageAPI GD
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2009 at 21:41 UTC
Updated:
2 Jun 2010 at 19:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedyou're sure the problem is not with the code for rotation when gd's rotate isn't available?
Comment #2
kaareimagerotate()in imagerotate.inc is working as expected without inverting the degree for any angle except 90 and 270. The shorthand rotation techniques for 90 and 270 were swapped. New patch attached. Swapping between toolkits gives the same result, except the imagerotate.inc version is a bit rough around the edges for non 90° angles ;-)And I haven't got access to any php installations with GD's
imagerotate()available, unfortunately.Comment #3
drewish commentedI just double checked that both GD and ImageMagick rotate the correct directions. So it sounds like it's our PHP implementation that's to blame.
Applying your patch reversed the rotation for GD.
The attached works for both GD and ImageMagick.
Comment #4
kaareI had to compile php with the bundled version of gd myself to experiment with imagerotate(). And indeed,
imagerotate()in GD bundled with php-5.2.6 rotates images counterclockwise. I believe it's the case also for php-5.2.8. I took a diff in thephp-5.2.X/ext/gddirectories and found no indication that it has been fixed.Anyway, this patch inverts the angle in
imagerotate()in imagerotate.inc so the implementations behave the same and the invertion inimageapi_gd_rotate()work for both versions.Comment #5
drewish commentedcommitted to HEAD and DRUPAL-6--1
Comment #7
kaareThe image still rotates the wrong way for 90° and 270°. Your patch in #3 is still required to fix the rotation in the php implementation.
Took me a year to figure this one out ;-)
Comment #8
drewish commentednope, that code has been committed. it just looks like it was never rolled into a release.
Comment #9
David Stosik commentedImage API GD is still rotating my images the wrong way for 90° and 270°. Using Ubuntu 10.04, with PHP 5.2 backport, and php-gd is installed.
Tried 270, 90 and 45 : only 45° is rotated the right way.
I just downloaded all the modules implied (ImageAPI, Imagefield, Imagecache).
Trying to remove the "360 - " in the call to imagerotate() fixes my problem.
Any hint anyone ?
Thanks,
David
Comment #10
drewish commentedDavid Stosik, which version are you using?
Comment #11
David Stosik commentedImage API 6.x-1.8
ImageCache 6.x-2.0-beta10
PHP 5.2.10
I just downloaded all of these yesterday.
Comment #12
dman commentedImageAPI DRUPAL-6--1-8 CVS
Imagecache DRUPAL-6--2-0-BETA10 CVS
GD bundled (2.0.34 compatible)
PHP 5.2.11
.. I'm not seeing this. a 90' and a 91' imagecache preset are both rotated clockwise for me.
Comment #13
David Stosik commentedDrupal status page tells me GD does not support rotation. I suppose ImageAPI GD is using its bundled function instead...
Comment #14
kaaredman, your version of gd is the one bundled with php. This issue is now regarding the version of php compiled without the bundled gd package, as it is in debian and ubuntu. These will trigger the usage of
imagerotate()from the included fileimagerotate.incin this project. And this version works for all cases except 90° and 270°.I did some testing using imagecache with a single rotate action and got these results using this image.
Unpatched:
80° 90° 100° 260° 270° 280°
With Drewish's patch from #3
80° 90° 100° 260° 270° 280°
Drewish, you may have misunderstood me earlier. Your patch in comment #3 is still required for the non-bundled version of gd to work properly. The original patch for this issue and my patch in #4 is applied an lives well, but imageapi_gd still fails for 90° and 270° on debian/ubuntu until #3 also is applied.
Comment #15
kaareThe attach/list behavior is awkward.. Anyway. See attachments for the rendered images both unpatched and patched.
Comment #16
kaareForgot 260, 270, 280, unpatched.
Comment #17
David Stosik commentedYes, I am using Ubuntu. :)
Drewish's #3 patch seems to be the solution. :)
Thanks fo the follow up.
Comment #18
drewish commentedGreat, thanks for all the testing. Committed to HEAD and DRUPAL-6--1.