I've been having trouble with the uploading interface failing to upload images. It does not display any kind of error message, and everything goes exactly as if the images were uploading successfully, but when I get to the gallery page, the images are not showing up.

The log entries in the admin/reports/dblog listing do not show any errors for the uploading process, just 404 errors from imagecache failing to find the images. Nothing about why they failed to upload in the first place.

Initially when I ran into this it was with images that contained non-alphanumeric characters in the filename, and when I cleaned up the filenames, they uploaded OK. But this latest batch have strictly alphanumeric filenames, and still failed to upload.

The Recent Log Entries listing shows first a series of 404s from ImageCache saying that it was unable to find the thumbnails for the uploaded images, then the same number of reports from content saying " node_gallery_image: added [shortened version of image title] ...", then another series of 404s from ImageCache matching the first set.

I checked the ImageCache folder and it didn't even create a directory for these uploads - the first gallery I created has all its images loose in the files/imagecache/node-gallery-thumbnail and files/imagecache/node-gallery-display folders, the second has them in a separate folder with the name of the gallery, and the third has nothing - no folder, no files.

I can't tell whether it's Node Gallery's uploading interface or ImageCache that's causing the problem, because I can't figure out where the original uploaded images are kept. The imagecache directory only has the sized versions, not the originals, so I have no way of telling whether they failed to upload, or whether they did upload but ImageCache failed to size them. Neither module appears to have recorded any error except ImageCache's 404s, which only refer to failing to find the thumbnails, not failing to find or size original images. (I also checked the error log on the web server itself, but it was unhelpfully completely blank, which I am going to take up with my web host.)

The one thing I found that I thought at first might explain it is that the folder name it was looking for in the 404s had a colon in it - it was the name of the gallery with spaces replaced with underscores, but the colon in the title (all the galleries on this site are named in the format Artist Name: Exhibition Name) was still there. So given the previous problem with characters in image filenames, I though that might be it. But then I checked the second gallery, and it had a colon in the name too, which did not appear to be causing any problems, so that's not it.

Does anyone have any ideas - either what might be going wrong, or anything more I can do to troubleshoot it? Specifically, it would be very helpful to know where the images are stored before being sized by ImageCache, because I haven't been able to find them, and if I could find them and see if there was anything there, I could at least pin down at what stage the problem was happening...

This is really kind of critical, because the site's already overdue and I really, really need to get these images uploaded!

Comments

spidersilk’s picture

Priority: Critical » Normal

OK, found the problem - I'd somehow failed to notice there was an ampersand in the gallery title as well as the colon. Removing that enabled me to upload the images.

However, this is still a pretty annoying bug. The displayed title of a node should NOT be directly turned into a directory name, with only spaces being converted to underscores. There are many other types of characters that might be desired in node names. For example, what do I do if an artist's last name is O'Neill or something? Or the title of an exhibition has a character that can't just be replaced by a word the way an ampersand can be replaced with "and"? Either the directory name should be editable or the module should do a better job of transliterating the node title. (And yes, I did install the transliteration module that ImageCache recommends. Didn't help.)

Also - it would be really, really nice if there was a way to re-upload images while keeping the information (title and caption) that had already been entered for them. Unless maybe there is and I just haven't found it? Having had to re-upload all the images in this gallery several times over, and re-enter all the info each time, impressed on me how good that would be.

I know the module's still in alpha, but I pretty much have to use it for this site because I need the galleries to be nodes so that they can be associated with magazine issues in the ePublish module (the site is for an art magazine). But maybe these are issues that could be addressed as the module evolves toward a full release.

Tally’s picture

The displayed title of a node should NOT be directly turned into a directory name, with only spaces being converted to underscores.

This is only true if you set up Node Gallery to use gallery titles for sub-directory names. About the only reason to use the gallery title for a sub-dir is for SEO. But, if that is the case, the titles and image filenames should be entered very carefully and all unusual characters would be avoided because they are not good for SEO.

You can set up the name of the sub-directories created for image storage to be something other than the gallery title. Edit the gallery relationship and you will see a field for Gallery Directory:.

I choose to use galleries/u%uid/g%gid for my gallery directory names. This avoids any problems with unusual characters in the gallery names. It also allows me to quickly go to the appropriate sub-dir if I ever need to.

Using something other than gallery title for sub-dir names will solve your immediate problem. Long term, Node Gallery could use a filter similar to that of PathAuto, which creates proper aliases from node titles.

spidersilk’s picture

I don't think I set the directory names any particular way - I must have missed that configuration option. Whatever way it's been doing it is just the default, I suppose. Good to know there is another way of setting it up, and I'll look into that - thanks!

Would you happen to know if changing the naming convention for the directories after having already created a few galleries and uploaded a lot of images will break the existing galleries, or just apply to new ones? The site is supposed to launch this week, and I'm a little wary of doing something that will break it (any further than I've already managed to, that is, but that's covered in another issue post).

If the method it was using for naming the directories is the default, and is likely to cause problems, maybe that default should be changed in future versions. Though as you say, having it do something like Pathauto (or like most other image gallery software does) and sanitize whatever directory names you choose would be best.

Also, with regard to this:

But, if that is the case, the titles and image filenames should be entered very carefully and all unusual characters would be avoided because they are not good for SEO.

I think it depends what you're considering an "unusual" character. Search engines are not thrown off by ordinary punctuation marks like colons, apostrophes, ampersands, etc. - if they were, they wouldn't be able to index ordinary page content! And for that matter, they seem to be able to do fine at indexing content in languages other than English, and most other languages have at least a few accents and things like that. Being able to use characters like that in image and gallery titles is important, especially for international sites. It only becomes a problem when trying to turn those titles into path names. The Transliteration module is supposed to work for accented characters, but it didn't seem to help with the punctuation problems I had.

Anyway, thanks again, and I agree that the best long term solution is something pathauto-like. In the short term, maybe the default naming convention could be changed to the one you recommend, and some kind of error message could be displayed if an image fails to upload for that or any other reason, to help people figure out the problem.

kmonty’s picture

Version: 6.x-2.0-alpha9 » 6.x-2.x-dev
Status: Active » Fixed

Fixed by this commit from this issue #584096: 'strange' characters in directory name will cause the image to not display

Thanks for reporting the issue initially!

Status: Fixed » Closed (fixed)

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