Periodically my clients call me because one of their thumbnails (or derivatives) is huge and not being resized. Invariably the problem turns out to be the file name. If I download the file, rename it something responsible, then re-upload, the files resize without a hitch.

The following file names have all caused the image module to choke (go ahead and test them):

  • T-MA-32 1900's cabinet $_1.jpg
  • 1890's wicker basket kent england $850.jpg
  • atl.homes jan.06' cover.jpg

As I've mentioned before, A quick glimpse into any of my clients' image directories is frightening. No matter how many times I explain to them how to properly name their files, they find a way to upload files with names like 1950's era His & Her's Banana Cannons, $12.50 & $16.95.JPG.

I have no idea if this is a problem with the image module, image magick toolkit or with Drupal itself.

Comments

zach harkey’s picture

Title: List of file names proven to choke the image module » Display errors when image name includes an apostrophe

Here's the latest culprit:

Margaret's Way elevation rendering.jpg

The derivatives are being created and named properly in the temp folder but in every view (eg. image/view/55/thumbnail, image/view/55/preview ), only the original is being displayed and the following errors are popping up:

Unable to create thumbnail image
Unable to create preview image

I removed only the apostrophe and re-uploaded it and it worked fine. It looks like the apostrophe the culprit.

- Apache/2.0.51 (Fedora) ext3 filesystem using ImageMagick

yched’s picture

I noticed that as well. Apostrophes in file names are troublesome.
This might be also related to the PHP magic-quotes setting - It's "On" on my host.

I submitted a patch for file.inc that corrects the problem.

yched’s picture

Version: 4.6.x-1.x-dev » 6.x-1.x-dev
Status: Active » Closed (duplicate)