Postponed (maintainer needs more info)
Project:
Flexinode
Version:
4.7.x-1.x-dev
Component:
Field type: image
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Feb 2006 at 07:36 UTC
Updated:
27 Jan 2007 at 11:31 UTC
Hi,
So I have a flexinode with a picture field in it. I write an article using this flexinode object, and when I click on "submit" I get many error messages.
* warning: Division by zero in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 125.
* warning: imagecreatetruecolor(): Invalid image dimensions in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 225.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 226.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 229.
* warning: Division by zero in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 125.
* warning: imagecreatetruecolor(): Invalid image dimensions in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 225.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 226.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 229.
* warning: Division by zero in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 125.
* warning: imagecreatetruecolor(): Invalid image dimensions in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 225.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 226.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 229.
* warning: Division by zero in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 125.
* warning: imagecreatetruecolor(): Invalid image dimensions in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 225.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 226.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /homepages/23/d154239500/htdocs/min/includes/image.inc on line 229.
The article is still created, the image is uploaded to server, and if I look into the database field, for the image field I get:
nid: 30
field_id: 8
textual_data: chat.gif
numeric_data: 0
serialized_data: O:8:"stdClass":8:{s:8:"filename";s:8:"chat.gif";s:8:"filepath";s:14:"files/chat.gif";s:8:"filemime";s:9:"image/gif";s:5:"error";i:0;s:8:"filesize";i:3635;s:6:"source";s:11:"flexinode_8";s:9:"smallpath";s:17:"files/chat_sm.gif";s:9:"thumbpath";s:17:"files/chat_th.gif";
Comments
Comment #1
thomjjames commentedI have the same issue, it says its something to do with the image.inc [has that changed for 4.7 it looked pretty similar to 4.6.5 to me, but i'm no expert].
Everything works fine [image uploaded and content inserted] apart this error.
thanks
Tom
Comment #2
thomjjames commentedHi, right i think i've sorted this one.
the problem was with the image size options form [flexinode_field_image_config function], the options were missing a closing ']', so the fields were not being read correctly thus causing the error.
i just added the the missing ']' to each option and it seems to have fixed the errors.
replace your flexinode_field_image_config function [line 137 i think] with this:
i don't know how to make a patch so if someone else out there wants to do that i'm sure lots of people would appreciate it.
thanks
Tom
Comment #3
thomjjames commentedsorry about the lack of code tags in my above post, for some reason it didn't work.
tom
Comment #4
Bèr Kessels commentedplease provide a real patch. http://Drupal.org/diffandpatch
Comment #5
samc commentedComment #6
bomarmonk commentedI tried this patch, but still have the same errors...
Comment #7
bomarmonk commentedOops... I din't mean to change the component... changing back to field type... but shouldn't this be code, as it relates to the inclusion of images in the body of the flexinode, etc? This isn't directly related to a field type, right?
Comment #8
bomarmonk commentedCan we get an update on this? Does this work? Will it be committed? I've tried this again, but I am still getting the same errors when updating a flexinode with an image field (ignore the stuff about general versus field comments, I think this is related directly to the field_image.inc file, as the errors occur with flexinodes whether or not they have inline images-- the common denominator is the image field for flexinode).
The above change doesn't make anything worse, so should the file be patched with this, even though it doesn't take care of these errors:
imagegif(): Unable to open 'files/AlpineSeal_th.gif' for writing in /gov/mysite/WWW/includes/image.inc on line 300.
imagedestroy(): supplied argument is not a valid Image resource in /gov/mysite/WWW/includes/image.inc on line 229.
imagegif(): supplied argument is not a valid Image resource in /gov/mysite/WWW/includes/image.inc on line 300.
imagecopyresampled(): supplied argument is not a valid Image resource in /gov/mysite/WWW/includes/image.inc on line 226.
imagecreatetruecolor(): Invalid image dimensions in /gov/mysite/WWW/includes/image.inc on line 225.
Thanks for any help with this. I can create a patch, if anyone can post code that will fix these errors. Thanks.
Comment #9
lekei commentedSorry but just to be thorough, bomarmonk...
in that last error message, are you sure that "nobody" (or whatever user httpd runs as) has read+write+modify permissions on the folder "files"?
Comment #10
bomarmonk commentedRight now my file permissions are definitely open to that...
Comment #11
Bèr Kessels commentedThere is still no patch.
Comment #12
mariuss commentedAt the top of field_image.inc there is this comment:
This seems to be the cause of these errors.
flexinode_field_image_insert() calls flexinode_field_image_make_smaller() and this calls image_scale().
image_scale() is in /includes/image.inc where all the errors are seen.
Comment #13
mariuss commentedMystery solved!
In Drupal 4.6 image fields have only two options: "Maximum picture dimensions" and "Maximum picture size".
In Drupal 4.7 there are four options: "Maximum picture dimensions", "Preview dimensions", "Thumbnail dimensions" and "Maximum picture size".
The update process will set the "Preview dimensions" the value of the old "Maximum picture size" and leave the last two empty. Also, the dimension should be of the format WidthxHeight but it is a simple number now.
So, just go to administer / content, content types and edit the image fields and set proper options.
The update method inside flexinode.install should be fixed I guess (if possible).
Comment #14
duntuk commentedcan you be more specific?
I can't find anything specific to what you're saying:
"go to administer / content, content types and edit the image fields and set proper options."
(what "image fields" are you refering to? where?)
closest i've found to "Maximum picture dimensions", "Preview dimensions", "Thumbnail dimensions" and "Maximum picture size".
is
Home » administer » settings » image
shows:
Label Width Height
thumbnail 100 100
preview 640 640
and there are 3 empty rows below that...
Comment #15
jdhorne commentedFix described in #13 confirmed for me. I simply re-edited the image fields in my flexinode forms, and checked to make sure the size parameters were present, and in the expected format. Once I did that, everything seemed to work just fine.
Comment #16
Bèr Kessels commentedComment #17
Bèr Kessels commentedhttp://drupal.org/node/65564 was marked duplicate of this issue.
Comment #18
Bèr Kessels commentedhttp://drupal.org/node/43436 was marked duplicate of this issue
Comment #19
Bèr Kessels commentedI committed quite some changes that fix all issues on a new installation. However, I am quite sure that an upgrade from 4.6 to 4.7 will cause trouble, since the no required config fields did not yet exsist ni 4.6.
For that, I would live to receive a database dump from flexinode_field in 4.6 format. IF you have some, it would be of great help if you shared that.
Comment #20
Bèr Kessels commentedwith al the fixes i think the priority can be brought down.
Comment #21
Bèr Kessels commented