lightspeedretail / webstore

Web Store eCommerce solution for Lightspeed
http://www.lightspeedpos.com/webstore
Open Software License 3.0
85 stars 63 forks source link

Image generation fails if image width is equal to image resize width #556

Closed facultymatt closed 11 years ago

facultymatt commented 11 years ago

Originally opened as https://github.com/lightspeedretail/webstore/issues/555 the real issue is below:

If LISTING_IMAGE_WIDTH or DETAIL_IMAGE_WIDTH === actual image width then the resize function fails, throwing the following: image.error : Failed to save file filename.ext. This causes ShowThumb() to throw a fatal error as well. Oddly, the original image is still deleted, as if the system misses the error and reads image resize as successful.

Observations: For example my original image is 512px wide x 424px tall. If I set DETAIL_IMAGE_WIDTH = 512 in the appearance panel, the image fails. If its 513 or 511 everything works fine. @note that DETAIL_IMAGE_HEIGHT doesn't seem to have the same issue.

Affected settings: LISTING_IMAGE_WIDTH (product grid page) DETAIL_IMAGE_WIDTH (product detail page)