Closed ChrisHardie closed 3 years ago
This error message doesn't appear in the TCPDF library itself AFAIK, so I think it's related to an underlying filesystem/network operation where the image can't be retrieved. I can imagine some hosts are set up intentionally or by accident to prevent curl/fetch requests from the same host to itself, so maybe that's it. Asking for more details from the user.
Received another report of this error message from a user when turning on the display of post thumbnails in the generated PDF:
TCPDF ERROR: [Image] Unable to get the size of the image: https:...
Confirmed that the images themselves were available and otherwise valid. Asked the user for host information; I hadn't heard back from the previous user mentioned above.
I was able to reproduce this today with the attached image.
For at least my local reproduction, based on https://stackoverflow.com/a/28007106/4891448 wondering if this is because of a self-signed SSL certificate.file_get_contents()
failed until I made an exception for verifying the SSL certificate (per https://stackoverflow.com/questions/1975461/how-to-get-file-get-contents-to-work-with-https). But, I don't think the original user error reports were on sites with self-signed certs...
Confirmed via xdebug that this is the error happening for me:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
A user reported that when trying to generate the PDF, they get this error:
The image in question was a valid JPG file and it worked fine in my local testing.
Some similar reports elsewhere about this tcpdf error indicate an issue with relative vs absolute file path names.