imagecache is not creatng the thumbnails on my site. When I try to go dfirectly to the image, I get these errors:

http://ubp.ngpsoftware.com/files/imagecache/bio/files/bios/02_swan.jpg

Page not found
* warning: getimagesize(files/imagecache/bio/files/bios/02_swan.jpg): failed to open stream: No such file or directory in /var/www/html/ubp.bm/html/modules/imagecache/imagecache.module on line 211.
* warning: filesize(): Stat failed for files/imagecache/bio/files/bios/02_swan.jpg (errno=2 - No such file or directory) in /var/www/html/ubp.bm/html/modules/imagecache/imagecache.module on line 214.
* warning: fopen(files/imagecache/bio/files/bios/02_swan.jpg): failed to open stream: No such file or directory in /var/www/html/ubp.bm/html/includes/file.inc on line 562.

What the heck do I have to do to get this to work. Nothing I try seems to do it. Getting more than a little frustrated here.

Comments

dopry’s picture

Priority: Critical » Normal

http://ubp.ngpsoftware.com/files/bios/02_swan.jpg doesn't exist. If the original image doesn't exists, of course imagecache isn't going to work.

Have you tried using a release version of imagecache instead of the dev version?

dopry’s picture

Category: bug » support

oh yeah, support not a bug.

seanr’s picture

That's incorrect - that file very much does exist. None of these error messages print out the path you listed. And how do I pull the release version from CVS?

quicksketch’s picture

I can't find the original image either. As dopry has said, if the original file does not seem to exist at /files/bios/02_swan.jpg, then the imagecache preset won't be able to find it either. You might check your file permissions and make sure that apache can read that file.

You can read the CVS version information at the main imagecache page on your site: /admin/settings/imagecache, right at the top. Or just open up imagecache.module and read the first line of the file.

seanr’s picture

Category: support » bug

That's because we'd deleted it temporarily since the nodes were showing HUGE images when I removed the imagecache stuff. It's back now. I've checked out DRUPAL-5--1-0 branch of this module and it still does not work.

$Id: imagecache.module,v 1.19.2.11 2007/01/24 21:54:03 dopry Exp $

benshell’s picture

Any solutions here? I'm having the same problem. The crazy thing is that some images work okay, and others don't. They are all jpg. They don't have spaces in the files. The permissions are all 777, and the owners are correct. If I delete the entire /files/imagecache folder, and then try to access a problem file, the folder structure will be rebuilt, but I'll get a Page Not Found and the same errors that seanr was getting.

However, on my localhost (with the exact same files and database) everything works fine. My localhost is on Windows though, so permissions are a completely different thing.

I'm using the DRUPAL-5-2 release of imagecache on a CentOS VPS with PHP 5.2.3. I have a lot of experience with all these things (Drupal, PHP, file permissions, etc) so I've been debugging this but I haven't figured it out yet.

erikhanson’s picture

I am having similar trouble. Image cache seems to be choking on only certain images though. The first time I got the error I was uploading a jpeg I downloaded from istockphoto. The original file was 300dpi and was 1598 x 2400 pixels.

After attempting to upload the file and getting the error I went into the directories to see what was going on. The file uploaded to both the thumbnail and the larger version I have set up, the issue was that the name was incorrect, the file I uploaded was named "380654.jpg" but the image on the server was named "imager.jpg" with another "imager_copy.jpg" with it. The file had been resized per imagecache instructions bit for some reason there was a hang up with renaming.

Then I resized the photo to 72dpi and dimensions of 800 x 1202 and used Photoshop's "Save for Web" feature to save as a jpeg. This time the file uploaded fine and imachecache worked as advertised.

Now I am not a PHP or server environment kind of guy, I know what I am running (CentOS with PHP 4.3.9) but other than that I know enough to be dangerous in server configuration. I have edited mt php.ini to handle larger file sizes (50mb for podcasts) so that shouldn't be an issue.

Does imagecache use a specific image toolkit to perform it's functions? If so, does one toolkit stand above the rest as a good choice?

Hopefully this info helps us all down the track of getting this issue fixed, for me running an image through Photoshop isn't a big deal, but for others it would be I'm sure.

2c’s picture

erikhanson ....

I wasn't getting thumbnails and then I installed imagemagick and it worked. Thanks for pointing me in the right direction!

2c’s picture

I should point out that gd2 library has difficulties working with images over a certain size. So, I was able to upload files that were <800Kb (everything was working) but anything bigger and the thumbnail wasn't being created.

ms2011’s picture

StatusFileSize
new1.76 MB

In my case, I have a particular image that won't upload. It's not the size, because if i resave using photoshop at the same size, it will work. I've tried saving as progressive JPG and non-progressive JPG--but both work. The original came from a Digital Camera... I'm not sure why only this image has trouble.

I should also note that i only has trouble on one of my servers. I can only imagine its some kind of server config or dependency issue but no idea what--the servers should be identical from imagecache perspective. I have tried uninstall/reinstalling the module, upgrading gd, installing imagemagick... all other images work but this one.

(see attached)

ms2011’s picture

StatusFileSize
new2.92 KB

and here's the EXIF info for that image in the previous post, if it is important...

ms2011’s picture

Evidently it has something to do with the filename. If I rename to "Copy of 2157LoritaWayDiningRoom.jpg", it works...

ms2011’s picture

Status: Active » Needs review
StatusFileSize
new559 bytes

ok, i figured it out--in my case, at least...

i don't know how, but what happened was a file was already created in the temporary directory:

/tmp/property_node2157LoritaWayDiningRoom.jpg

so when imagecache_cache() saw that it already existed, it failed to file_move() it from $tmpdestination to $destination.

therefore, every other command afterward getimagesize(), filesize(), fopen() would fail on the $destination path.

my proposed solution is to make sure we move the file in this case! (see attached patch)

harabk’s picture

I have confirmed mikes' patch - it does fix the issue.

darren oh’s picture

Status: Needs review » Reviewed & tested by the community
dopry’s picture

Status: Reviewed & tested by the community » Needs work

that is a lock file that is a trick that imagecache 1.x uses to prevent several apache calls from processing the same file. It is used as a lock in a way. I believe head gets around this issue. Can you test with head?

i'm not about to move a file that another process is or could be manipulating, so the proposed solution will not fly.

raspberryman’s picture

sub

rick hood’s picture

The same thing described in #13 above is happening with me, which I posted as an issue here: http://drupal.org/node/209892).

I am using Imagecache 5.x-1.x-dev 2007-12-18.

Dopry says above "I believe head gets around this issue. Can you test with head?" - Not sure if this dev version (2007-12-18) still contains the fix he put in HEAD.

Dopry also says the patch posted above is not recommended.

Thanks for any help.

dopry’s picture

This should be fixed in 2.x... see if it works for you, but I would only play with it in testing for now....

dagomar’s picture

This is not fixed in 2.x

dopry’s picture

This issue is noisy. If you're still having issues with imagecache 2.x or 1.x generating issues please open your own issue with detailed information to reproduce the error you are experiencing.

dopry’s picture

Status: Needs work » Closed (fixed)

do not reopen this issue!