Re: another puzzle!

Hussein Shafie <[email protected]>
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
On 3/4/20 3:33 PM, Grundtvig Nielsen Niels wrote:
> Using the technique you explained to me, I have am now comfortable 
> preparing <fig> elements that contain more than one <image>. Just one 
> case, however, is now giving strange results: which is all the stranger 
> when I have used exactly the same technique and settings for other pairs 
> of graphics and not run into any problems.
> 
> ·in XML Mind (two graphics_xxe) the identical images, both resized at 
> 21%, are the same height on screen
> 
> ·output to .pdf (twoGraphics_acrobat) they show up at different heights
> 
> What have I creatively managed to get wrong this time? let me know if 
> you need any source files for examination.
> 


When displaying an image, XXE does not care about the resolution of 
raster images (GIF, PNG, JPEG, etc). It just considers the image size 
in pixels. (Web browsers do this too.)

All XSL-FO processors (FOP, XEP, XFC, AHF, etc) consider the resolution 
of raster images in order to determine the *absolute* image size (i.e. 
in cm, mm, in, etc). When this resolution is not stored in the image 
file, the default resolution is 72dpi, 96dpi or 120dpi depending on the 
XSL-FO processor and its configuration.

My guess is that the "YUMI_28.png" and "YUMI_29.png" files contain 
different resolution info (or "YUMI_28.png" contains no resolution info, 
hence defaults to something like 120dpi and "YUMI_29.png" contains 72dpi).

In order to get consistent results when generating PDF, it is almost 
mandatory to store resolution info in your raster image files.

Storing resolution info in the raster image file should be easy using 
any image editor.

For example, using GIMP (free, open source, highly recommended; 
https://www.gimp.org/), it's the "Image|Print Size" menu item, "X 
Resolution" and "Y Resolution" fields in pixels/inch. See attached 
screenshot.


--
XMLmind XML Editor Support List
[email protected]
https://www.xmlmind.com/mailman/listinfo/xmleditor-support
Gimp_image_print_size.png (image/png, 192.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.