This content has been marked as final. Show 7 replies
Can you give an example that reproduces this problem?
Sure, no problem.
The image I started with was 1280x960 at 72dpi.
<cfimage source="d:\projects\test.jpg" name="img">
ImageCrop(img, 66, 270, 458, 229);
ImageResize(img, 100, 50);
<cfimage source="#img#" action="write" destination="d:\projects\test-thumb.jpg" quality=".85" overwrite="yes">
The user would click on the image to come up with x, y, w and h values.
Thanks for the help
Yes, that seems like a rounding problem. Christian Küpers mentioned something about this on Ben Nadel's blog. I do not know if the math works out in every case, but notice how incrementing the value slightly produces a 100x50 image, instead of 99x49? That seems to support the theory it is a rounding problem.
ImageResize(img, 100.0001, 50.0001);
Yeah, I go to Ben's website to find answeres to most of my problems.
Thanks I just add ".0001" to my variables and it works perfectly. Thanks
Yes, I have read it occaisionally and there are some good entries. I just happened to remember seeing something about resizing problems in the comments when researching how to create transparent gif's. I re-checked google and sure enough, there it was ;-)
Btw, if you do not see any image function fixes in the latest hot fixes, you might consider submitting a bug report on this issue.
I did not see anything related to that so I'll submit it. Thanks again.
Just an update. The issue is now included in the Known Issues section of the Release notes for the recent ColdFusion 8 Update 1.
Sometimes the ImageResize function produces an image 1 pixel shorter or
narrower than the requested size. The image does resize properly if you
specify bicubic, bilinear, nearest, or highestPerformance as the
interpolation parameter value.