Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
"Unable to get imagesize" instead of "image not here" #526
A few weeks ago, I worked with an old version (from around 2016?) of HTML2PDF and in this version if a image (Source of an IMG-Tag) was not there, I got a readable error-message like "the image xy could not be loaded".
But now, with the newest Version of HTML2PDF, I get a "HTTP Error 500" and after analyzing I realized, that its really only the not existing image, which is the reason.
The HTTP500 occurs only because I get the content via PHP "ob_get".
The real Error behind of this is: "Fatal error: Uncaught Spipu\Html2Pdf\Exception\ImageException: Unable to get the size of the image".
Here is a realtime-test:
Not working (just IMG-filename changed):
What can I do or what is the next step, to find out, what's going wrong here?
Thanx a lot,
Thanx, @Mr-TOA !
Yes, I am using the latest version [5.2.1].
And yes, sorry - of course you need the code - here we go:
@Mr-TOA Yes, I installed it through composer.
And the latest versions seemst to be 5.2.1, look here: https://github.com/spipu/html2pdf/blob/master/CHANGELOG.md
If you install locally with composer, there are two versions (or at least on my windows machine). The "technickcom" folder holds newest 6.2.25.
Using it solved a lot of problems for me, including the imagesize issue experiencing with older Spipu version. Had to do a little reconfigure, but my app seems much smoother now:)
Do you speak about TCPDF?
Or am I wrong here and there are different versions of html2pdf?
PS: I have also the tcpdf-folder with the tcpdf-version 6.2.25 in it - therefore "yes, I use the actual version".
@Anton-Korduan My bad, you are correct.
Guess I used TCPDF in technickkom folder without Spipu. Only way I got around the imagesize issue. Lost ability to use the example templates, but least can use TCPDF:)
Take a look at example 61 in technickkom/example folder and load external file. Using that method was able to get my project working.