Closed (outdated)
Project:
ImageMagick
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2012 at 20:32 UTC
Updated:
20 Jan 2025 at 15:35 UTC
Jump to comment: Most recent
Comments
Comment #1
fietserwinFormula from: http://stackoverflow.com/questions/3231176/how-to-get-size-of-a-rotated-...
o = angle
new x = x * sin(o) + y * cos(o)
new y = x * cos(o) + y * sin(o)
image_rotate_dimensions() in image.effect.inc in Drupal core should do the same: #1551686: Image rotate dimensions callback can calculate new dimensions for every angle
And another link that explains it: http://actionscripthowto.com/bounding-box-of-a-rotated-rectangle/
Comment #2
fietserwinThe formula above only works fin the 1st quadrant. I found a complete example and converted it into working Drupal PHP code (including tests) in the Drupal core issue #1551686: Image rotate dimensions callback can calculate new dimensions for every angle. It can be copied right into this module or if and when it becomes available in D7, this module can call the core code directly.
Please review and comment over there.
Comment #2.0
fietserwinUpdated issue summary.
Comment #3
mondrakeDrupal 7 is EOL