Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004642 [Quercus] minor always 06-27-11 10:37 07-06-11 14:23
Reporter rickHigh View Status public  
Assigned To
Priority normal Resolution open  
Status feedback   Product Version
Summary 0004642: Problem displaying images with PDFLib
Description I would expect this to work.


$logo = $pdf.load_image("auto", "images/caucho-logo.png", "");
if ($logo == -1)
  throw new Exception("Error: " + $pdf.get_errmsg());

$pdf.fit_image($logo, 50.0, 500.0, "");

$pdf.close_image($logo);

It does not work and it does not display anything. If it could not find the image, the expectation is that it would return -1 as per PDFLib documents.

I also tried this:


$logo = $pdf.load_image("auto", "random_text_that_is_not_a_real_image.jpg", "");
if ($logo == -1)
  throw new Exception("Error: " + $pdf.get_errmsg());

$pdf.fit_image($logo, 50.0, 500.0, "");

$pdf.close_image($logo);


I would expect the above to throw an exception. It does not.
Additional Information
Attached Files

- Relationships

- Notes
(0005336)
rickHigh
06-27-11 11:03

Scott looked into the code and it is not supporting PNG at this time.

I converted the PNG to a JPG and retried. It did not work.

$logo = $pdf.load_image("auto", "images/caucho-logo.jpg", "");
if ($logo == -1)
  throw new Exception("Error: " + $pdf.get_errmsg());

$pdf.fit_image($logo, 50.0, 500.0, "");

$pdf.close_image($logo);


Then I tried an absolute path and it did not work.



$logo = $pdf.load_image("auto", "/Users/rick/tools/resin/resin-pro-4.0.19.1/doc/admin/images/caucho-logo.jpg", "");
if ($logo == -1)
  throw new Exception("Error: " + $pdf.get_errmsg());

$pdf.fit_image($logo, 50.0, 500.0, "");

$pdf.close_image($logo);
 
(0005344)
domdorn
07-04-11 09:39

you can't use the dot for accessing an object in PHP.

try

$logo = $pdf->load_image(...)

the dot is for string concatenation.
 
(0005357)
domdorn
07-06-11 10:42

please update if the issue is solved.
if not, please send me the full code or link to the gist so I can take a look
 
(0005361)
rickHigh
07-06-11 14:23

The code is in the admin tool.

/home/svn/svnroot/resin/trunk/php/admin

post-mortem-pdf.php
 

- Issue History
Date Modified Username Field Change
06-27-11 10:37 rickHigh New Issue
06-27-11 11:03 rickHigh Note Added: 0005336
06-27-11 14:01 kdecherf Issue Monitored: kdecherf
07-04-11 09:39 domdorn Note Added: 0005344
07-06-11 10:42 domdorn Note Added: 0005357
07-06-11 10:42 domdorn Status new => feedback
07-06-11 14:23 rickHigh Note Added: 0005361


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
37 total queries executed.
30 unique queries executed.
Powered by Mantis Bugtracker