OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Re[2]: [docbook-apps] XEP and .PNG images created with Gnome's DIA


Alan Ezust <alan.ezust@gmail.com> writes:

> I filed the bug, and it was closed as "not a bug".
> 
> apparently there is still a bug in XEP with regards to rendering PNG files. 
> It does not read the correct resolution from the file.
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=312179

XEP can't read the correct resolution from the file if the
resolution information in the file is not correct. :)

The bug is in your PNG file.

Try installing pngcheck(1) or some other utility that can display
chunk-level information from PNG files, and use that to view the
data in the pHYs chunk of your account.png file. What you will see
is something like the following.

  $ pngcheck -v account.png
  File: account.png (5299 bytes)
    chunk IHDR at offset 0x0000c, length 13
      217 x 182 image, 24-bit RGB, non-interlaced
    chunk sBIT at offset 0x00025, length 3: red = 8 green = 8 blue = 8
    chunk pHYs at offset 0x00034, length 9: 2000x0 pixels/meter
    chunk IDAT at offset 0x00049, length 5206
      zlib:  deflated, 32K window, default compression
    chunk IEND at offset 0x014ab, length 0
  No errors detected in account.png (95.5% compression).

Note the "chunk pHYs at offset 0x00034, length 9: 2000x0 pixels/meter"
line. That specifies the horizontal/vertical (x and y) physical
resolution of your image. A y value of 0 makes no sense. The y
value should be the same as the x value, if you want most apps to
be able to handle it correctly.

So if you created that account.png file using some version of DIA,
then it seems there is a bug in whatever version of DIA you're
using. What version is it? When I use the v0.94 version of DIA on
Linux, it exports PNG images correctly, with both the x and y
values in the pHYs chunk set to the same value (2000).

Try opening and resaving your account.png file in the GIMP or some
other image-edting app. What you'll see afterwards for the pHYs
chunk is something like this:

  chunk pHYs at offset 0x00025, length 9: 2835x2835 pixels/meter (72 dpi)

So the GIMP has changed/corrected the data in the pHYs chunk --
because the "2000x0" data it found there is not usable. If it does
find usable data in the pHYs chunk, it will not change it (unless
of course you explicitly set a different resolution before you
save the file).

  --Mike

> On 7/18/05, Alexander Peshkov <peshkov@renderx.com> wrote:
> > 
> > Hello Alan,
> > 
> > This PNG is broken so the bug is in DIA. Some graphic formats
> > supports internal information about image resolution and some does
> > not. PNG can have such information and, if present, this information
> > should be contained in pHYs chunk of the image data. DIA does writes
> > this data chunk into PNG, but fails to specify proper resolution for
> > an image (vertical resolution is set to 0). So the processing of such
> > image depends on the particular application fall-back strategy. Some
> > application may decide to treat such image as having no information
> > about the resolution at all, other will rise the error. I bet you are
> > using very old version of XEP (that followed first strategy), because
> > modern version of XEP will reject such image with appropriate error
> > message.
> > 
> > Note that actual size of the image without intrinsic resolution will
> > be determined individually by each application depending on default
> > resolution it uses. XEP default is 120 DPI (you can read more about it
> > in the Section "5.1. Bitmap Graphics" of "XEP Reference").
> > 
> > Conclusion: fix DIA or use some tool to postprocess those PNGs (after
> > I've re-saved your 'account.png' using XnView it worked fine with
> > XEP). If you have image without intrinsic resolution - specify image
> > dimensions explicitly in your document.
> > 
> > Best regards,
> > Alexander Peshkov mailto:peshkov@renderx.com
> > RenderX
> > 
> >

-- 
Michael Smith
http://sideshowbarker.net/

smime.p7s



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]