Cfimage ArrayIndexOutOfBoundsException when trying to rotate image

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">

	<cfimage source="#fileInfo90#" action="rotate" destination="#testPath#/test90.jpg" overwrite="yes" quality=".9" angle="90">
	<img src="/test90.jpg">
	<cfdump var="#cfcatch#">

I doesn’t see any exception while rotate image. I’ve tested with image I can rotate the image in all angles without any issues. Can you add Image file here in which you’ve checked with. In which version this error is reproduced ?.

Thanks for getting back to me. It doesn’t happen with all of the with all of the photos. Here’s one of the photos that’s causing problems.

I’ve checked with your above image, it’s working as expected without any issues. The given images rotated in all angels.

I’ve tested this to both 4.5 and latest 5.2 versions.

does this forum software re-process the image? maybe upload to a jira task just to be sure?

Yes, I tried to link to the original file.

The photos is on this page - (it’s being cropped from the original)

Here’s the url for the original file (just remove the space in the URL) tj22088_090317_155322_1134634.JPG

Here’s another one that’s not working… tj19775_092817_171044_1138949.JPG

I’ve tested with above two images & Both are rotated in all angels without any issues. Just tried to the images as directly from the url (Using cfhttp), even it’s working as expected.

Maybe it’s related to the OS - I’m running on Debian 8. What OS did you test on? I’ll do some more testing on my end.

I’m working in windows 7.