XF 2.0 Attachment Import Issue


New member

During a import from vBulletin 4.2.3 to XenForo we are getting the following error:

Fatal error: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data in ..../library/XenForo/Image/Gd.php on line 86

Has anybody else experienced this issue, and have you found a solution?

We are running PHP 5.6.36 and GD library 2.1.1.


Well-known member
Update/reinstall the GD library.

Or try switching to Imagick here:

ACP -> Setup -> Options -> Attachments -> Default image processor -> Imagemagick PECL extension


New member
Thank you for the feedback.

We'll try to install Imagemagick PECL extension and activate.

Would this error only be a result of invalid image files? Is it possible to ignore/skip these files and continue the import?

Also, it is possible to see the original files causing the issues? When I var_dump the $filename I only see the something like temp/xfgyaydc and I'm not sure if this is the original file.


XenForo moderator
Staff member
It is possible it's due to a corrupt file.

You could look at the XF database/file system and identify the last imported attachment.
It should be the next one (in the VB database) which is corrupt.

If you can identify it, you can likely delete it from the VB database and attempt the import again.