Image thumbnails broken after upload

Created on 18 May 2016, over 8 years ago

I know I am still stuck with Drupal 6. But recently I wanted to provide Classified Ads support so I installed ed_classified module and then use Node Images to provide support to add multiple images.

Node Images works for most part. The only problem is that when I upload the images, the table shows broken thumbnails. However after I save the node, the images and their thumbnails are shown properly. I can access them at http://mydomain/system/files/node_images/myimage.jpg and I can see them under files/node_images directory.

The link that the thumbnails are pointing to, as seen in the browser's Inspect Element, is the wrong path. It is missing node_images. So it would be http://mydomain/system/files/myimage.jpg.

However I noticed that after upload (but before saving the node) the node_images directory does not even have the original picture nor the thumbnail. It is probably somewhere in some other temp directory. I checked /tmp and I don't think I see it there, definitely not by the name that it was uploaded with. Looks like images are uploaded somewhere, but after saving the node, the images are actually transferred over to the node_images directory.

So the issue is two folds. The path to thumbnail is wrong after upload, missing the node_images. But even if the path would be fixed, it won't fix the broken thumbnail issue, because the image file is not in the final directory yet until the node is saved. The path will have to be the path where the image is actually uploaded - the temp path wherever it is. I see "width=50" so I guess at this point it is not expecting a thumbnail, it is simply trying to reduce the size of the uploaded image to be shown as thumbnail.

Anyone has any idea or a fix. I would appreciate it.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇰Pakistan muhammad.tanweer

    I recently had an issue where when I would upload a new image (and before saving the form), the image uploads via ajax (standard with drupal), but the thumbnail showed broken. I checked and the thumbnail was available in files directory. The image would show when i would right lcick on the broken thumbnail and hit "load image". After stumbling on many things I found it was a blank space at the start of one of my custom module files. This thread helped.

    https://www.drupal.org/project/drupal/issues/2195311 💬 Image styles not generated on first page load until page refreshed Fixed

Production build 0.71.5 2024