this took a long time to figure out... here's what happened

using imagefield cck and imagecache and node_import, i imported a lot of nodes with images attached. The images were moved to the files directory no problem, but upon viewing my nodes, some of the presets were being generated, but most of them weren't. It turns out that imagecache was failing on this php function: getimagesize($src) in imagecache.module ln 327.

My jpegs which displayed fine in the browser by using the direct filepath, were actually not valid jpegs according to this php function. So... I added this right above the original getimagesize loop:

if (!getimagesize($src)) {
// Image may be corrupted, try to open jpeg and resave as valid jpeg with php
$reimg = imagecreatefromjpeg($src);
imagejpeg($reimg,$src); // Rewrite to src
}

Worked for me, hope someone finds this helpful.

Comments

drewish’s picture

Category: bug » support
Status: Active » Fixed

going to close this since it's still searchable but not an imagecache bug.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.