As reported on g.d.o, in http://drupal.org/node/166732, http://drupal.org/node/176157 (including a patch), http://drupal.org/node/168180 and http://drupal.org/node/171524 (Image issue) some inline images disappear from contents. As far as I can tell, cron does not need to run to let this happen. It's unclear, if (any) node updates are the cause.

However, the cached content must have been updated, because those missing images are the cause for malformed urls and onclick behaviours:

<a href="http://localhost:82/files/" onclick="launch_popup(9, , ); return false;" target="_blank">

The image file, along with its derivatives, is not deleted and still resides in the files directory. However, in the files table the original image file entry is missing. The only entry found is foo.img_assist_properties.bar.

The problem is not reproducable by updating the node containing the image.

By visiting the image node, the image is missing in all sizes (certainly caused by missing entries in files table).

Uploading the same image into the same image node displays the image in the image node, including derivative sizes. However, the img_assist filter tag in the content containing that image needs to be updated to have it displayed also there.

This happens repeatedly. It's not the same image that gets lost.

http://drupal.org/node/160671 (Image issue) could be related.

CommentFileSizeAuthor
#2 img_assist_26.patch5.24 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Now I experienced this bug several times after

  1. Inserting an image into a node using Img_Assist's filter tag
    Note: For demonstration purposes use an image from "my images" and count the number of displayed images.
  2. Going to admin/settings/image and adding/altering/removing a preset size
    Note: I did not even think of altering anything there in my initial post, so this step might not be related.
  3. Emptying Drupal's cache using devel.module's Empty cache link in the devel block.
  4. Going straight back to the node edit form of the node containing the inline image, invoke img_assist and see at least 1 image less.
sun’s picture

Assigned: Unassigned » sun
Status: Active » Needs review
FileSize
5.24 KB

smk-ka and I debugged this issue thoroughly and came to the conclusion that Image Assist deletes original images from the files table if an image is smaller than a derivative size. See attached patch for a more comprehensive description.

I urge everyone to test this patch ASAP. You probably need devel module to subsequently clear all caches.

FYI: _image_get_sizes() is deprecated, also changed in this patch.

sun’s picture

Status: Needs review » Fixed

Committed to 5.x.

zoo33’s picture

I had a quick look at the patch and also tested the current -dev version briefly, including following the procedure in comment #1. No problems so far. Good work!

Anonymous’s picture

Status: Fixed » Closed (fixed)