Ask your WordPress questions! Pay money and get answers fast! (more info)

Fix errors caused by autonav plugin WordPress

  • SOLVED

I am using the autonav plugin (http://wordpress.org/plugins/autonav/faq/) which shows the first image from each post in a specific defined category.

I just moved to a new host and suddenly get the following errors such as these:

Warning: imagecreatefromgif() [function.imagecreatefromgif]: '/home/rewardch/public_html/wp-content/uploads/2013/05/mothers-day-coupon-book.gif' is not a valid GIF file in /home/rewardch/public_html/wp-content/plugins/autonav/autonav-wl.php on line 109

Warning: imagesx(): supplied argument is not a valid Image resource in /home/rewardch/public_html/wp-content/plugins/autonav/autonav-wl.php on line 50

Warning: imagesy(): supplied argument is not a valid Image resource in /home/rewardch/public_html/wp-content/plugins/autonav/autonav-wl.php on line 50

Warning: imagesx(): supplied argument is not a valid Image resource in /home/rewardch/public_html/wp-content/plugins/autonav/autonav-wl.php on line 133

Warning: imagesy(): supplied argument is not a valid Image resource in /home/rewardch/public_html/wp-content/plugins/autonav/autonav-wl.php on line 133


This is a sample page with the errors: http://www.rewardcharts4kids.com/mothers-day-printables/

This is the solution provided by the plugin developer:

<blockquote>When sites are moved between web hosts, or generally in the case of WordPress not being able to create a new monthly uploads directory, the internal WP core function wp_upload_dir will return only an error, and not any useful information about existing uploads. This prevents AutoNav from discovering where your uploads directory is at all, which is why things break.

WP 3.5 and later properly return both "where uploads are supposed to go" in addition to an error message.

Version 1.5.3 of AutoNav will show WP 3.5 as the minimum version, and will also be more graceful in simply not displaying images for the case of WordPress 3.4.2 and below.

SOLUTION.
1.Upgrade to the latest WordPress
2.Correct the permissions on your uploads directory.</blockquote>

BUT, I am using the latest version of WP and the permissions are correct. Just adding this in case it can help.

Another thing, this is only happening on pages that are using GIF images and not with other images such as jpg.

Answers (5)

2014-08-18

zebra webdesigns answers:

Hello printables

this is my first level of investigation.
I am available in skype to discuss further.
skype ID: bhuvan530531

The issue is the images you are having are actually png images. but wrongly saved as gif.
you need to rename those images as .png

I have checked your images with the following code and identified them as non gif images.
I also tested with original gif images from internet and worked without issues.

to check yourself you can drag the image and save it to you system, you can see the image is saving as png file

http://www.rewardcharts4kids.com/wp-content/uploads/2013/05/mothers-day-coupon-book-1.gif

<?php
if (exif_imagetype('image.gif') != IMAGETYPE_GIF) {
echo 'The picture is not a gif';
}
?>


zebra webdesigns comments:

and to be more precise, you can open your images in notepad or notepad ++
and I see the sign as ‰PNG

which confirms my facts.


printables comments:

That's interesting. I will try and change them as png and see if that helps. I will update you.


printables comments:

Yes, you were right! I saved it as a jpg and it solved the problem! Thanks!


zebra webdesigns comments:

awesome :)

2014-08-18

Arnav Joy answers:

have you uploaded all the files in upload folder also ?

And one more thing , have you checked the permission of upload folder ?

it should be writable or you can give 755 permission.


printables comments:

Yes, I have uploaded all the files.
The permissions are 755

2014-08-18

timDesain Nanang answers:

the image is exist:
http://www.rewardcharts4kids.com/wp-content/uploads/2013/05/mothers-day-coupon-book.gif

is the 'rewardch' your username in cpanel / new hosting?
is the wordpress installed in the root folder (/public_html/) ?


printables comments:

Wordpress IS installed in the root foler.
Yes, rewardch is the username


timDesain Nanang comments:

yep. zebra got the clue
<blockquote>
The issue is the images you are having are actually png images. but wrongly saved as gif.
you need to rename those images as .png
</blockquote>

try this code:

$info = getimagesize( WP_CONTENT_DIR .'/uploads/2013/05/mothers-day-coupon-book.gif');
print image_type_to_mime_type($info[2]);


the output is: <strong>image/png</strong>
since the image is png not gif

2014-08-18

Navjot Singh answers:

Seems the issue is not new. A [[LINK href="http://wordpress.org/support/topic/is-it-possible-to-updatefaq"]]similar complaint[[/LINK]] that these errors pop randomly after shifting hosting.

So can you try renaming the file mothers-day-coupon-book.gif to mothers-day-coupon-book.GIF and check if that works?

And if it doesn't then going by [[LINK href="http://wordpress.org/plugins/autonav/"]]plugin's homepage[[/LINK]] its mentioned that if you face errors, you can try using [[LINK href="http://downloads.wordpress.org/plugin/autonav.1.5.0.zip"]]1.5.0[[/LINK]] version of the plugin.

Try that maybe?


printables comments:

Yes, I saw that and tried both but neither helped:

I did try and rename all images. I changed them all to GIF but it didn't help.
I also tried using 1.5.0 and that didn't help either.

2014-08-18

Bob answers:

it is possible it is host issue see the last comment.
[[LINK href="http://wordpress.org/support/topic/is-it-possible-to-updatefaq"]]http://wordpress.org/support/topic/is-it-possible-to-updatefaq[[/LINK]]

How you uploaded images? via ftp?
if you moved it via ftp can you try uploading few files using media library?
are uploaded image files visible in your media library?

how you moved site? did you used any tool like backupbuddy, wptwin, duplicator or did it manually?