mpdf / mpdf.github.io

mPDF documentation
https://mpdf.github.io
Other
508 stars 160 forks source link

img tab src url formating issue. #176

Closed dev3-omeecron closed 2 years ago

dev3-omeecron commented 2 years ago

Our HTML contains image tag and src with 2 spaces inside url.

<span style="font-family:Arial,Helvetica,sans-serif"><img src="https://briscoproduction.com/BRISCO_NEW/Wholesale/src/25A21V2-5000  Road Tripping - Sand Tee Shirt.jpg" style="height:85px; width:85px"></span>

when we try generating a pdf the URL becomes a single space and we are getting a 404 response at end pdf throws

Fatal error:  Uncaught exception 'Mpdf\MpdfImageException' with message 'Error parsing image file - image type not recognised, and not supported by GD imagecreate (https://briscoproduction.com/BRISCO_NEW/Wholesale/src/25A21V2-5000%20Road%20Tripping%20-%20Sand%20Tee%20Shirt.jpg)' in /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php:1346
Stack trace:
#0 /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php(983): Mpdf\Image\ImageProcessor->imageError('https://briscop...', true, 'Error parsing i...')
#1 /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Tag/Img.php(276): Mpdf\Image\ImageProcessor->getImage('https://briscop...', true, true, 'https://briscop...', false)
#2 /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Tag.php(239): Mpdf\Tag\Img->open(Array, Array, 649)
#3 /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(15382): Mpdf\Tag->OpenTag('IMG', Array, Array, 649)
#4 /var/www/html/BRISCO_NEW/Wholesale/function.php(10518): Mp in /var/www/html/BRISCO_NEW/assets/mpdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php on line 1346