VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: GJC Web Design on May 31, 2020, 13:40:37 PM

Title: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: GJC Web Design on May 31, 2020, 13:40:37 PM
Just posting this here as it may help someone.

Client reported the standard "no emails on orders" and found that the PDF invoice was failing with TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxx.com/images/virtuemart/shipping/sefl.gif
Image and path all correct and it really was a gif ( not the png problem )

found in libraries\vendor\tecnickcom\tcpdf\tcpdf.php ~ line 6823 ( of a 24,500 line file!!!  no wonder no one is interested in this pdf shite ) in the function Image()
that the vendor image passed correctly but the ship/payment images failed ..
the error Unable to get the size of the image is btw very generic .. just means something failed in the image processing.

The vendor file was  images/stories/virtuemart/vendor/xxxx-Logo.gif

the ship/pay file was https://www.xxxx.com/images/virtuemart/shipping/sefl.gif

i.e. fully qualified url - why this should start to fail I don't know ...it has always been like this in VM afaik - client swears nothing changed on the server
The images are accessible by direct url.
Site is VM3.8 and TCPDF1.08

but removing the host by

   
/** GJC remove the host */   
        $uri = JUri::getInstance();
        $file = str_replace($uri->getScheme().'://'.$uri->getHost().'/','',$file);
    /** GJC remove the host */


and everything started working again
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: nistune on June 01, 2020, 13:13:58 PM
We have just seen this exact issue since the weekend. Order emails stopped coming in, and then manually confirming them showed the TCPDF error

No idea what changed... added some images into the Joomla media folder last week, and a few article modifications

Where did you add this line? Immediately inside Image() function?

I'm getting various errors similar to yours with my payment and postage methods, even though they have worked for the last five years(!)
TCPDF ERROR: [Image] Unable to get the size of the image: https://nistune.com/images/virtuemart/payment/btn_paywith_primary_m.png

Joomla! 3.9.18
VirtueMart 3.6.10 10211
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: Jörgen on June 01, 2020, 13:30:51 PM
TCPDF if AFAIK NOT PNG compatible.

Jörgen @ Kreativ Fotografi
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: GJC Web Design on June 01, 2020, 23:34:10 PM
note my post above states this is not a png problem .. b4 altering the tcp file try with a gif first ..

if it still fails then try removing the host with the above .. and yes .. it is added as the first line of the function
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: Jörgen on June 02, 2020, 06:11:58 AM
Quotehttps://nistune.com/images/virtuemart/payment/btn_paywith_primary_m.png
Jörgen
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: GJC Web Design on June 02, 2020, 09:33:07 AM
yes .. I saw that he is using a png .. just reinforcing that my fix had nothing to do with the known png problem .. the error was thrown on all image types
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: Jörgen on June 02, 2020, 09:36:41 AM
OK. did not get get that :)

Jörgen @ Kreativ Fotografi
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: Zegenrijk on June 02, 2020, 17:05:22 PM
Same problem here. Suddenly more than one site reports this problem, just a few days ago it works and now a few days later the described problem (nothing changed, no updates). The work around is a quick solution, but looking for the cause and real solution.

Regards Michel
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: Zegenrijk on June 03, 2020, 18:49:12 PM
Quick thought -> maybe not relevant, but when nothing changes and multiple sites have suddenly problems without knowing each other, could this maybe the problem -> happens on 30 may: https://www.agwa.name/blog/post/fixing_the_addtrust_root_expiration
Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: nistune on June 04, 2020, 00:29:55 AM
QuoteTCPDF if AFAIK NOT PNG compatible.
Yeah I found that out when searching this forum for the error message. However two things:
1. My PNG files (including this one) always worked previously for all orders (over the last five years) when they came in (prior to the weekend)
2. When I changed my PNG files to JPG/GIF, I still got the same error message with those files

Anyway the fix by GJC Web Design does work on new orders (since the fix) coming in now

Just updating the existing orders (marking as confirmed, shipped state) that is when I could repeat the message on the orders with the broken image links. There is a new problem and maybe that root key might be a cause?




Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: GJC Web Design on June 04, 2020, 09:21:20 AM
QuoteJust updating the existing orders (marking as confirmed, shipped state) that is when I could repeat the message on the orders with the broken image links.

The path /html to the image is stored in the DB under the ship method but the "fix" still should remove the host... strange



Title: Re: TCPDF ERROR: [Image] Unable to get the size of the image: https://www.xxxxx~.gif
Post by: nistune on June 11, 2020, 00:56:51 AM
Even with the fix added, I got this error today when updating the order Confirmed state. This one is a GIF file, similar to the OP
TCPDF ERROR: [Image] Unable to get the size of the image: https://nistune.com/images/virtuemart/shipment/australia-express-courier-international.gif

I upgraded Joomla to Joomla! 3.9.19 which did not change my modified tcpdf.php file