WordPress.org

Ready to get started?Download WordPress

Forums

POST2PDF Converter
TCPDF Error with images (7 posts)

  1. lucile
    Member
    Posted 2 years ago #

    Hello,

    When I generate PDF file from a post, it works only if there's no image in the post. If there is an image, I have this error message:

    Warning: getimagesize() [function.getimagesize]: php_network_getaddresses: getaddrinfo failed: Name or service not known in my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php on line 8015

    Warning: getimagesize(http://xxxxx.xxx.xx/wp-content/uploads/2012/02/testimage.jpg) [function.getimagesize]: failed to open stream: Success in my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php on line 8015
    TCPDF ERROR: Missing or incorrect image file: http://xxxxx.xxx.xx/wp-content/uploads/2012/02/testimage.jpg

    If I type the image URL in my web browser, the image is displayed.
    I've done tests with small images, it's the same...

    What can I do? Thanks for your help!

    http://wordpress.org/extend/plugins/post2pdf-converter/

  2. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, lucile san

    getimagesize() [function.getimagesize]: php_network_getaddresses: getaddrinfo failed: Name or service not known in

    Maybe, your server can't resolve the own domain name to IP address and fail to open image files.

    You may need to modify hosts on the serevr to resolve this issue.

    You had better consult with the server administrator.

  3. lucile
    Member
    Posted 2 years ago #

    Hi redcocker,

    Thanks a lot, we modified /etc/hosts on our server by adding the IP and the name of the site, and it works perfectly!

    Thanks again!

  4. lucile
    Member
    Posted 2 years ago #

    One more question... Do you confirm that the pdfs are generated locally and that no data are sent outside?
    Thanks!

  5. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, lucile san

    Do you confirm that the pdfs are generated locally and that no data are sent outside?

    Only when "Cache" option is enable or using "4.PDF Converter" in the setting panel, PDF is generated in the server disk.

    This plugin doesn't sent any data outside.
    But I don't know whether TCPDF sents data outside or not
    I believe that TCPDF is not such a PHP class.
    Because TCPDF is widely used.

    http://www.tcpdf.org/

  6. lucile
    Member
    Posted 2 years ago #

    Thanks for these info.

    Actually we have an other problem, with png and bmp images.

    The error message when a post contains png file is:

    Fatal error: Uncaught exception 'ImagickException' with message 'unable to open file my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/http://xxxxx.xxx.xx/wp-content/uploads/2012/02/bullet.png'' in my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php:8255 Stack trace: #0 my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php(8255): Imagick->readimage('http://xxxxx….') #1 my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php(7724): TCPDF->ImagePngAlpha('http://xxxxx….', 16.000125, 100.751722222, 45.3543307087, 45.3543307087, 4.51555555556, 4.51555555556, 'PNG', 'http://xxxxx….', 'B', false, 300, '', 'b7b6cd0ce801d07…') #2 my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php(23225): TCPDF->Image('http://xxxxx….', 16.000125, 100.751722222, 4.51555555556, 4.51555555556, '', 'http://xxxxx….', 'B', false, 300, '', false, false, 0, false, false, true) #3 my_wp_path_on_my_server/wp-content/plugins/post2pdf-convert in my_wp_path_on_my_server/wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php on line 8255

    For the bmp files, it's simply:

    TCPDF ERROR: [Image] Unable to get image: http://xxxxx.xxxx.xx/wp-content/uploads/2012/02/test.bmp

    Our Linux distribution is Ubuntu 8.04 LTS with the last version of ImageMagick for this version (dpkg -s ImageMagick => Version: 7:6.3.7.9.dfsg1-2ubuntu1.2)

    If you have any idea...

  7. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, lucile san

    Sorry I have no definitive answer.

    we modified /etc/hosts on our server by adding the IP and the name of the site, and it works perfectly!

    I think you can try to add your domain name to following line in hosts.

    127.0.0.1 localhost xxxxx.xxxx.xx
    * xxxxx.xxxx.xx = YOUR_DOMAIN

    If you have added server's global IP and your domain name, try to delete them.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic