I’m trying to rotate an image 90 degrees, but when I do I’m getting an index out of bounds exception. During testing I was able to rotate the image 89 degrees and 91 degrees, but not 90 degrees.
As I was creating the screenshot below I found something else that was interesting.
When I resized the image to 400 I was able to rotate it 90 degrees. I didn’t need to resize the images that were rotated 89 or 91 degrees (I only did it to make it fit in a screenshot). The first image is the actual image.
Any suggestions would be greatly appreciated!
Test Code
<cfimage source="#testImage#" name="fileInfo">
<cfset fileInfo89 = Duplicate(fileInfo)>
<cfset fileInfo91 = Duplicate(fileInfo)>
<cfset fileInfo90 = Duplicate(fileInfo)>
<cfset ImageResize(fileInfo,400,"")>
<cfset ImageResize(fileInfo89,400,"")>
<cfset ImageResize(fileInfo91,400,"")>
<cfset ImageResize(fileInfo,400,"")>
<cfimage source="#fileInfo#" action="rotate" destination="#testPath#/test0.jpg" overwrite="yes" quality=".9" angle="0">
<cfimage source="#fileInfo89#" action="rotate" destination="#testPath#/test89.jpg" overwrite="yes" quality=".9" angle="89">
<cfimage source="#fileInfo91#" action="rotate" destination="#testPath#/test91.jpg" overwrite="yes" quality=".9" angle="91">
<img src="/test0.jpg">
<img src="/test89.jpg">
<img src="/test91.jpg">
<cftry>
<cfimage source="#fileInfo90#" action="rotate" destination="#testPath#/test90.jpg" overwrite="yes" quality=".9" angle="90">
<img src="/test90.jpg">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>