Bug 14770 - PDF Renderer does not work with .bmp images.
Summary: PDF Renderer does not work with .bmp images.
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: 0.20.4
Hardware: PC All
: P1 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-22 14:45 UTC by Derrick Koes
Modified: 2012-04-01 13:48 UTC (History)
0 users



Attachments
example fo which exhibits the problem (3.69 KB, text/plain)
2002-11-22 18:30 UTC, Derrick Koes
Details
Correct sample which exhibits the problem. (3.74 KB, text/plain)
2002-11-22 20:05 UTC, Derrick Koes
Details
Example servlet which retrieves images. (2.50 KB, text/plain)
2002-11-22 20:06 UTC, Derrick Koes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derrick Koes 2002-11-22 14:45:52 UTC
The PDF Renderer issues a stack trace handling bitmap images.  This also 
prohibits subsequent renderings of files without bitmap images.

org.apache.fop.apps.FOPException: 921600
	at org.apache.fop.apps.Driver.render(Unknown Source)
	at org.apache.fop.apps.Driver.run(Unknown Source)
...
java.lang.ArrayIndexOutOfBoundsException: 921600
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
	at org.apache.fop.apps.Driver.render(Unknown Source)
	at org.apache.fop.apps.Driver.run(Unknown Source)
Comment 1 Oleg Tkachenko 2002-11-22 16:07:02 UTC
Excuse me, but without seeing details (see
http://nagoya.apache.org/bugzilla/bugwritinghelp.html) I would consider the bug
as INVALID. Provide a reproducible example, please.
Comment 2 Derrick Koes 2002-11-22 18:30:34 UTC
Created attachment 3921 [details]
example fo which exhibits the problem
Comment 3 Oleg Tkachenko 2002-11-22 19:06:00 UTC
Works fine for me, of course except for
http://doradb1/dora/MediaContentHandler?type=image&id=1&mimetype=image/jpeg
Chances are the problem is there. Try to run without this image, if it helps,
check  that MediaContentHandler returns image correctly (mime-type,
content-length etc).
Comment 4 Derrick Koes 2002-11-22 20:05:18 UTC
Created attachment 3926 [details]
Correct sample which exhibits the problem.
Comment 5 Derrick Koes 2002-11-22 20:06:10 UTC
Created attachment 3927 [details]
Example servlet which retrieves images.
Comment 6 Derrick Koes 2002-11-22 20:08:50 UTC
Using the provided example servlet, RetrieveImage, I can successfully retrieve 
an image to the browser.  However, using the example fo provided, I cannot 
successfully retrieve the image to a pdf document.
Comment 7 Oleg Tkachenko 2002-11-23 21:03:01 UTC
Your servlet works very inaccurately with those buffers:
byte[] chunk = new byte[4096];
while (fis.read(chunk) > 0)
{
    dos.write(chunk);
}
Think what a garbage you are outputting in a very last iteration. 
When you are copying buffers always make sure you are writing the same amount of
bytes you are reading. Use the following pattern:

int bytesRead;
byte[] chunk = new byte[4096];
while ((bytesRead = fis.read(chunk)) > 0)
{
    dos.write(chunk, 0, bytesRead);                    
}
Comment 8 Derrick Koes 2002-11-25 14:33:06 UTC
RetrieveImage was simply meant as an example (cut and paste from the "real" 
code).  I guess that's what I get for not looking at it thoroughly.  The 
corrected stream read/write "fixed" the problem.
Thanks Oleg for your diligence.
Comment 9 Glenn Adams 2012-04-01 13:48:03 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs