Re: BMP-error and resolutions

2002-06-04 Thread J.Pietschmann
Malin Norrstrand wrote:
1. In the fop specs it says that output images will have a resolution of
72 dpi. I have tried generating pdf with jpgs and gifs of both 72 dpi
and 600 dpi, and it seems like fop does not care about changing
resolution. Does anybody know how this works?
I'm not sure how you managed to create GIFs or JPGs with a
specific resolution. Both are bitmap formats, their size is
primarily mesured in pixels. In order to render bitmaps on
physical media which lacks a pixel structure (like paper),
the resolution in form of dpi measurements kicks in. A
resolution of 72dpi means thet 72 dots (pixels) are printed
per inch, or roughly 100 pixels per 3.53 cm. There may be
metadata in the image files specifying some resolution,
AFAIK FOP ignores this completely. You can, however, specify
the absolute height and/or width on the fo:external-graphic
object. If you use
 
the image is scaled so that it is exactly one centimeter wide
in the rendering result, regardless of number of pixels or
resolution measurements.

2. When trying to generate a pdf with a bmp image in it, I get an
exception. Does fop only support some types of bmp, and if so, which
ones? I have tried with screenshots and downloaded images, and some bmps
saved in Photoshop. The exception:
FOP understands uncompressed BMP, presumably the Windows
variant (there is an OS/2 too), with true color (24bit per
pixel), 256 color (8bit), 16 color (4 bit) and b/w (1 bit).
I'm not a graphic format guru, so I can't tell about various
subvariants involving palette sizes and inverted colors and
RLE and other compression schemes.
I have no problems rendering BMP files created with MS Paint
or the netpbm toolkit. The exception:
java.lang.ArrayIndexOutOfBoundsException
at org.apache.fop.image.BmpImage.loadImage(BmpImage.java:120)
signals an array overflow while reading the pixel array.
That's strange, if FOP doesn't understand the format, it
should have thrown an exception already. If you still get
the same error with a 50x50 pixel BMP created with MS paint,
I'd suspect a buggy or corrupted JVM which doesn't correctly
report EOF conditions.
J.Pietschmann


BMP-error and resolutions

2002-06-04 Thread Malin Norrstrand

Hello all!

I have two questions concerning Fop and PDF. 

1. In the fop specs it says that output images will have a resolution of
72 dpi. I have tried generating pdf with jpgs and gifs of both 72 dpi
and 600 dpi, and it seems like fop does not care about changing
resolution. Does anybody know how this works?

2. When trying to generate a pdf with a bmp image in it, I get an
exception. Does fop only support some types of bmp, and if so, which
ones? I have tried with screenshots and downloaded images, and some bmps
saved in Photoshop. The exception:

java.lang.ArrayIndexOutOfBoundsException
at org.apache.fop.image.BmpImage.loadImage(BmpImage.java:120)
at
org.apache.fop.image.AbstractFopImage.getBitmaps(AbstractFopImage.java:2
31)
at org.apache.fop.pdf.PDFXObject.output(PDFXObject.java:163)
at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:1202)
at
org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:708)
at
org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:217)
at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:81)
at
org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:307)
at
org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:200)
at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:182)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser
.java:559)
at
org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceB
inder.java:853)
at
org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.
java:643)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValida
tor.java:2978)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.ja
va:918)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(X
MLDocumentFragmentScannerImpl.java:1145)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XML
DocumentFragmentScannerImpl.java:988)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1446)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo
cumentFragmentScannerImpl.java:333)
at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:529)
at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
:1148)
at org.apache.fop.apps.Driver.render(Driver.java:481)
at org.apache.fop.apps.Driver.run(Driver.java:554)
at
se.infologic.ibase.client.export.ExportXml.write(ExportXml.java:160)


Thanks!