because $image_size is not reset on each iteration, image size info from already processed images will incorrectly be assigned to images that do not exist or do not have image info.

To reproduce, create a node with image resize filter applied to it with the following code:

<img src="path/to/working_file.gif" width="1" height="1" />
<img src="path/to/404_file.gif" width="1" height="1" />

the second image (and all other 404 images that come after a resizable image) will have the $image_size info of the last successfully processed image, resulting in a 404 at files/resize/path/to/404_file.gif and for me also another error: thrown by imageapi: "The selected image handling toolkit can not correctly process _image_close."

solution is to reset $image_size at beginning of each iteration.
Patch attached.

EDIT: Wrapped code in <code> tags.

Comments

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, an obvious improvement. I'll include this next time I'm working on Image Resize Filter.

quicksketch’s picture

Title: resizes images needlessly » May attempt to resize non-existent images
Status: Reviewed & tested by the community » Fixed

Committed to D6 and D7 branches.

Status: Fixed » Closed (fixed)

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