Oberto / php-image-magician

Image manipulation at it's finest.
http://phpimagemagician.jarrodoberto.com
91 stars 54 forks source link

Fix to intermittent Crop resize issue #1

Closed samatcd closed 11 years ago

samatcd commented 11 years ago

Patches a bug in the Image Magician library which could cause the crop resize option fail for some images resizing to specific sizes.

Images affected by this bug would be resized to optimumWidth / Height, but comparisons on optimum vs new would then fail and the crop wouldn't take place.

Simply rounding the optimum values in the getOptimalCrop method fixes this issue.

Oberto commented 11 years ago

Hey, sorry your pull request took so long. It's now merged with main.

Cheers for that. J.

On Thu, Nov 22, 2012 at 2:25 PM, Sam Sehnert notifications@github.comwrote:

Patches a bug in the Image Magician library which could cause the _crop_resize option fail for some images resizing to specific sizes.

Images affected by this bug would be resized to optimumWidth/Height, but comparisons on optimum vs new would then fail and the crop wouldn't take place.

Simply rounding the optimum values in the getOptimalCrop method fixes

this issue.

You can merge this Pull Request by running:

git pull https://github.com/samatdf/php-image-magician master

Or view, comment on, or merge it at:

https://github.com/Oberto/php-image-magician/pull/1 Commit Summary

  • Fixed an issue where image crops could fail due to lack of rounding

File Changes

  • M php_image_magician.php (4)

Patch Links