Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All the preloaded images including demo content cause this warning.
Notice: getimagesize() [function.getimagesize]: Read error! in image_gd_get_info() (line 349 of /var/www/html/adhesions/drupal/modules/system/image.gd.inc).
The resulting image file is only 2 bytes in size and invalid.
Can upload new images OK
Comment | File | Size | Author |
---|---|---|---|
#6 | system_get-image-size_1678568.patch | 607 bytes | flyingkiki |
Comments
Comment #1
askandlearn CreditAttribution: askandlearn commentedSo how does one go about getting rid of this error?
Comment #2
kamenrs CreditAttribution: kamenrs commentedI receive the same error message.
Comment #3
jam.ing CreditAttribution: jam.ing commentedThis manual patch works for me, it got rid of the message, and allows me to see which image file(s) caused the issue.
File to modify: var\modules\system\image.gd.inc
line 349
// $data = getimagesize($image->source); //was original line
$img = drupal_realpath($image->source);
if (filesize($img) > 10 )
{ $data = getimagesize($img);}
// this filters out files that have a size of less than x bytes which is probably a corrupted file.
// I found this original patch on http://drupal.org/node/1522348, but it didn't work because the filesize() function returns and int
// not a bool
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedI have traced the error to problems with populating the demo content. It turns out that the image files imageX.png get copied to imageX_1.png (where X = {1,5}) and then even to imageX_2.png and imageX_3.png while playing with the enable/disable the demo content. However, for some reason the png files which are typically 250k plus in size get truncated to 2 byte length files, which are of course invalid. The error message occurs when the properties of the file are unexpectedly invalid.
The patch above is a workaround. But the real problem seems to be why the files get copied to the ones with the _1 and _2, and why do they get clobbered?
Comment #5
kaizerking CreditAttribution: kaizerking commentedsame case here
Comment #6
flyingkiki CreditAttribution: flyingkiki commentedcreate a patch according to comment#3
Comment #7
kaizerking CreditAttribution: kaizerking commented#6 patch did not work
Comment #8
jackhutton CreditAttribution: jackhutton commentedfollowing this issue..
Comment #9
jackhutton CreditAttribution: jackhutton commentedI used jam.ing 's patch in #3 which cleared the message but sounds like a bug needing a fix.. thanks for posting your experience here.. saved alot of time,..
Comment #10
fayedrupal CreditAttribution: fayedrupal commentedTry Configuration -> Image styles
Overridden the default setting
should work