Firstly - I an not 100% certain this is the fault of taxonomy_image, however that is the module that I've just installed and am trying to use - so I suspect it.
I get this in a drupal error message:
* warning: Division by zero in /home/svn/codebase/drupal/ecommerce-5.8/modules/imagecache/imagecache.module on line 183.
* warning: getimagesize(imagecache/splash-image/files/pictures/qcs-woman.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/svn/codebase/drupal/ecommerce-5.8/modules/imagecache/imagecache.module on line 208.
* warning: filesize() [function.filesize]: stat failed for imagecache/splash-image/files/pictures/qcs-woman.jpg in /home/svn/codebase/drupal/ecommerce-5.8/modules/imagecache/imagecache.module on line 209.
I believe the directory it's meant to be looking in is under /files/imagecache not just /imagecache
Again I am not certain it is this module, I will be certain by tomorrow.
Comments
Comment #1
nancydruI have seen the "failed to open stream" message many times and don't understand it because the image IS usually displayed.
At any rate, TI has no control over which directory IC is using. Moving to the ImageCache queue. You probably need to check which version of that module you are using.
Comment #2
danielb commentedImagecache 5.x-1.6
these errors all come from the function imagecache_cache() where the var $dst is "imagecache/splash-image/files/pictures/qcs-woman.jpg" which is a 404 path, the correct path is "/files/imagecache/splash-image/files/pictures/qcs-woman.jpg"
the var $dst is set like so:
$dst = 'imagecache/'. $preset .'/'. $src;
so I don't understand how it will ever look in the 'files' directory ?
Here is the best part though (and see my attached images for this), I am uploading a picture which is the exact same size as my preset, and imagecache appears to be screwing it up!
My settings for splash-image preset:
If I change 'center center' to 'top left' it works fine, but I don't want 'top left' (for when larger pictures are uploaded I want to chop off the sides).
Comment #3
nancydruWhat I always do is to crop first, then scale. Something like Crop 500x500 center, then scale to 280x280. Well, actually, I usually use % for the cropping.
Comment #4
danielb commentedso if you upload an image that is 640x480 it will crop it to 500x480 and then scale it to 280x270 leaving 5px of black space at the top and bottom of the image. not good.
Comment #5
xurizaemonI'm seeing this issue too, after recently upgrading UberCart and ImageCache. I'm using UberCart-5.x-1.3 and ImageCache-5.x-1.6.
It seems to happen when the image is first referenced, and before it's cached. So you'll see the warning on the page AFTER the image is displayed.
Applying this page fixed the path issues for me: http://drupal.org/node/303903#comment-1014613
However, the div by zero was still there. I won't claim to fully understand the code around it, but I found that adding some defaults at line 168 of imagecache.module (5.x-1.6) fixed it for me.
Combined patch (incorporates the one linked above) attached, but would appreciate review.
Comment #6
xurizaemon(duplicate post, oops)
Comment #7
danielb commentedWould like to confirm that reverting to version 1.5 fixed the division, path, and also my crop/scale problem.
My server admin says that the 1.6 version looks like a few lines of code have disappeared from it. Perhaps somebody has sat on the keyboard while the maintainer was in the toilet etc...
I would advise you to compare the 1.5 version for a patch, rather than trying to innovate.
Comment #8
shawn dearmond commentedI have this problem with:
Drupal 5.10
Imagecache 5.x-1.6
Imagefield 5.x-1.2-rc1
Views 5.x-1.6
It happened both on a views block and on a views page.
I applied the patch in http://drupal.org/node/309049#comment-1015097 and it didn't work for me. Nothing changed, even after I clicked "flush preset images".
I reverted to Imagecache 1.5 and that worked... though I'm not a big fan of moving backwards.
Has anyone tried upgrading to ImageCache 2.1 and ImageField 2.1?
Comment #9
treksler commentedcan also confirm that 'center' keyword for cropping no longer works in 1.6
have moved back to 1.5 for now
Comment #10
nancydruI gave up on trying to get the image path right, so I moved to 5.x-2.x and that problem went away.
Comment #11
bhill9270 commentedfrom another forum, install php5-gd on the server.
Comment #12
fizk commented