Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#44 Image() with no size

closed
nobody
None
5
2012-10-09
2011-09-12
Anonymous
No

When using $pdf->image() without a width and an height and the path is relative starting with a "/" image display fails.

line 7361 till 7366 of version 5_9_14:
if (@file_exists($file)) {
// get image dimensions
$imsize = @getimagesize($file);
} //else {
$imsize = false;
}

changed it to:
if(!$imsize = @getimagesize($file))
{
$imsize = false;
}

hoop this helps its my first patch/bug report

Discussion

  • Nicola Asuni
    Nicola Asuni
    2011-09-13

    The current code sees working fine and the proposed patch doesn't have much sense, since the file_exists call is done to avoid calling getimagesize function for non existing file (this is required because getimagesize always trigger errors in this case).
    If you are having problems loading the image, probably you have to install the php-curl extension or simply enabling getimagesize access to your server resources.