Strange error when uploading an image

spidersilk - November 6, 2009 - 06:10
Project:Image
Version:6.x-1.0-beta3
Component:image.module
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I've just run into a strange error while trying to upload one particular image. At first I thought it was an img_assist error, since that was how I initially tried uploading it, and got the following:

* Unable to create scaled Inline image.
* The selected file /[path to my web directory] could not be copied.
* warning: Division by zero in /[path to my web directory]/sites/all/modules/img_assist/img_assist.module on line 891.

(Where "[path to my web directory]" was the actual path to my web directory, removed from this post for security reasons.) But then I tried uploading it directly as an image, using Create Content > Image, and that didn't work either:

* Unable to create scaled Preview image.
* The selected file /[path to my web directory] could not be copied.

So apparently, the problem is happening with the image module itself. It seems to be losing track of the image's location for some reason - in all the error messages, it just has the path to my web directory where the path to the image should be. And the image does not appear in the files directory where the other images are.

I checked phpMyAdmin to see what was going on in the database, and it looks like when the image is uploaded, it writes records to the node table and the files table, but not to the image table. In the files table, it shows the filename correctly, and gives the location as "sites/[domain name]/files/images/temp/[filename]" (again, domain name and filename being the actual domain name and filename). So I checked the temp directory, and there were several versions of the image there (because I had tried uploading it several times). It looked like it had gotten to different points resizing it each time. In some cases it was able to create a thumbnail version but not a preview version, in others it create a preview version but not the custom size it would have after that, and in some it didn't even get as far as a thumbnail. I cleared them all out, and every record pertaining to any of the failed attempts in the database, and tried again, but still got the same result.

This has not happened with any other image - and there's nothing odd or unusual about the image it is happening with. It doesn't have any weird characters in the filename, it's not exceptionally large or anything - it's just an ordinary JPEG like every other one that did upload successfully. I tried renaming it, and even opening it up in a graphics program and resaving it at a smaller size with a different name, but nothing works.

I *was* able to upload that image through a CCK imagefield, so I know it's not that the image has anything horribly wrong with it. But it just will not upload through the image module!

Does anyone have any ideas what could possibly cause something like this to happen? The admin log shows no errors (except the initial division by zero error from image assist), and the status report says that both GD and ImageMagick are installed correctly. The site is using the latest stable versions of all modules.

#1

brunitto - November 14, 2009 - 15:09

I am have the same problem and I can add one more clue:

In the screen Home » Administer » Site configuration » Images I got the following warning:

warning: Parameter 1 to theme_image_settings_sizes_form() expected to be a reference, value given in /var/www/viko/includes/theme.inc on line 617.

Thanks.

#2

tani.com - November 22, 2009 - 14:15

HI,
I have the same problem and we are discuting here: http://www.drupalitalia.org/node/8792
Any suggestion will be appreciate

#3

joachim - November 24, 2009 - 08:39

Weird things about the image that cause this could include:
- image dimensions (try another one the same size)
- file size
- file name (any odd characters in the filename?)
There could also be weird jpeg gremlins. Have you tried copying the image within a graphics editor and pasting it into a fresh file?

 
 

Drupal is a registered trademark of Dries Buytaert.