Hi,

I'm using imagecache a lot to create square thumbnails. 1.6 doesn't give me the wanted result anymore. You can see what I get in the attachment.

Preset is something like

- Scale
- outside dimensions
- width: x
- height: x
Crop
- width: x
- height: x
- center
- center

CommentFileSizeAuthor
#4 scale_crop.png84.01 KBderjochenmeyer

Comments

vladsavitsky’s picture

I have the same problems with crop action in 1.6 and 2.1

hansrossel’s picture

Same problem here when upgrading from 1.5 to 1.6, scale+crop does not function correct anymore.
Reverting back to 1.5 solved the problem.

jadwigo’s picture

I can confirm this

I get the following errors in my messages:

# warning: Division by zero in [..]/sites/all/modules/imagecache/imagecache.module on line 183.

# warning: getimagesize(imagecache/thumb/files/pictures/picture-148.jpg) [function.getimagesize]: failed to open stream: No such file or directory in [..]/sites/all/modules/imagecache/imagecache.module on line 208.

# warning: filesize() [function.filesize]: stat failed for imagecache/thumb/files/pictures/picture-148.jpg in [..]/sites/all/modules/imagecache/imagecache.module on line 209.

And the following messages in the watchdog:

is_file() [<a href='function.is-file'>function.is-file</a>]: open_basedir restriction in effect. File(files/tmp/tmp_imagecache_065004657dbf3089b8f2a6df1d453433_thumb_picture-139.jpg) is not within the allowed path(s): ([..]:/tmp:/usr/local/lib/php/) in [..]/includes/file.inc op lijn 468.

filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for imagecache/thumb/files/pictures/picture-139.jpg in [..]/sites/all/modules/imagecache/imagecache.module op lijn 209.

getimagesize(imagecache/thumb/files/pictures/picture-139.jpg) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: No such file or directory in [..]/sites/all/modules/imagecache/imagecache.module op lijn 208.

Division by zero in [..]/sites/all/modules/imagecache/imagecache.module op lijn 183.

The behaviour for the keyword "left" instead of "center" gives no problems.

derjochenmeyer’s picture

StatusFileSize
new84.01 KB

Got the same problem, see attatched screenshot.

benovic’s picture

same here

omnyx’s picture

Same problem here - as a result all my user's profile pictures are messed up! (I use imagecache profile picture module)
you can see an example here
http://www.thehvoice.com/files/imagecache/user_image_default/files/user_...

I'd appreciate any ideas on how to tackle this.
I presume I could go back to ImageCache 5.x-1.3 which seemed to work fine. A quick question - when disabling imagecache module for upgrade (or downgrade) do imagecache presets remain intact in the database. I ask this because a previous upgrade seemed to have messed up my presets.

hansrossel - when you went back to 1.5 did you first disable the imagecache module, updated the new files, reenabled it and ran update.php? What happened to the presets?

maartenvg’s picture

Status: Active » Closed (duplicate)

This is a duplicate of #242932: revision 1.19.2.36 throws divide-by-zero and other errors when first generating a derivative, which has fixed and committed to dev.

So either use 5.x-1.x-dev, or use the patch mentioned in the above issue.