The error is:
Recoverable fatal error: Argument 1 passed to image_resize() must be an instance of stdClass, boolean given, called in /var/www/drupal7/profiles/uw_base_profile/modules/contrib/image_resize_filter/image_resize_filter.module on line 499 and defined in image_resize() (line 279 of /var/www/drupal7/includes/image.inc).
Steps to recreate:
- Create an image that is not what it says it is (for instance, rename a BMP file with the JPG extension)
- Start creating a node where you can upload and insert an image.
- Upload and insert the image at its original size, and drag to resize. (The image displays in the editor, because browsers are lenient about this sort of thing.)
- Save the node and watch Drupal crash.
I have patch in progress.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | invalidimage-1933342-1.patch | 1.08 KB | kpaxman |
Comments
Comment #1
kpaxman commentedMy patch checks to make sure that an image was successfully created; if not, it reverts back to the original file (using the code from "move remote images into place if they are already the right size"). There may be a nicer, cleaner way to handle this, but this at least clears the error.
Comment #2
joelstein commentedI can confirm this exact bug, but I didn't try the patch. I just re-uploaded an image with the proper extension.
Still, it seems some graceful error handling is in order.
Comment #3
zil.arman commentedkpaxman,
I've faced the same problem. Your patch helped me.
Thanks a lot!
Comment #4
ar-jan commentedI can confirm this works. Patch applied to 1.14 (succeeded with offset of 17 lines).
It's actually quite important to handle this somehow; in our case this problem also prevented administrative pages such as content overview from working, not just the node view of the node containing the problematic image.
Comment #5
vinmassaro commentedA user renamed a .bmp file to .jpg and had it embedded in the WYSIWYG area. This caused the fatal error in #1 for us which this patch fixed. Please commit, thanks!
Comment #6
ram4nd commentedComment #9
PierreLittle commentedI need some help with this issue on my site. Willing to contract it out. pmlitttle@gmail.com