I had a very odd error where the image showed as style'ed but was using the wrong source image. When I deleted the style'ed image and reloaded the page, the correct image displayed and was style'ed.

I haven't figured out how to reproduce the error, but I am positive the source image didn't change.

1 Answer 1


This was likely a file-naming conflict of sorts. ImageCache (the module responsible for generating the image styles) generates a file name for each image style, and then checks for the presence of that file. If the file exists, it is served to the browser, otherwise it is generated and then served.

If you had a file called fruit.jpg that resulted in an image style of /files/styles/some/folder/fruit.jpg, and then deleted the source file, it is possible that the derivative style file wasn't removed (keep in mind, this a theory). If you then uploaded a different image with the same fruit.jpg filename and tried to generate the same image style again, ImageCache would find the previous /files/styles/somes/folder/fruit.jpg and serve that, resulting in the confusion you're seeing.

That said, I do believe derivative image styles get deleted when the source image is deleted, but I'm not sure of the specifics (ex. timing - it may happen during a cron run which wasn't ran).

For the most part, I wouldn't worry about it. Sounds like a onece in a million edge-case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.