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

CommentFileSizeAuthor
#6 system_get-image-size_1678568.patch607 bytesflyingkiki
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

askandlearn’s picture

So how does one go about getting rid of this error?

kamenrs’s picture

I receive the same error message.

jam.ing’s picture

This 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

Anonymous’s picture

I 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?

kaizerking’s picture

same case here

flyingkiki’s picture

create a patch according to comment#3

kaizerking’s picture

#6 patch did not work

jackhutton’s picture

following this issue..

jackhutton’s picture

I 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,..

fayedrupal’s picture

Try Configuration -> Image styles
Overridden the default setting

should work