> Date: Wed, 8 May 2013 10:34:29 +0300
> From: [email protected]
> To: [email protected]
> Subject: [Gimp-developer] How "Print Size" can save pixel density into e.g.   
> png file?
> 
> I use the feature of changing image print density (in dpi) in GIMP to
> get predictable size of printed image. Now i want to do this
> programmaticaly. I tried to grep the code, but it would take me long
> time to figure this out by myself. Could please somebody describe in
> which way png file carries pixel density information, or point to the
> place in code that actually does this information saving to file.
> Thanks in advance.
> --
> Andrey Utkin
> _______________________________________________
> gimp-developer-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Sounds like you need to look at the PNG specs themselves, not necessarily 
GIMP's method of writing to them:

http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html
http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html

Specifically, DPI is encoded into the PNG file in the "pHYs" data chunk, as a 
pair of 4-byte unsigned integers representing "pixels per unit" along each 
axis, followed by a single byte specifying the unit of measure (note the only 
supported unit is "meter", not "inch").

http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.pHYs


-- Stratadrake
[email protected]
--------------------
Numbers may not lie, but neither do they tell the whole truth.
                                          
_______________________________________________
gimp-developer-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gimp-developer-list

Reply via email to