-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for encoding metadata chunks #116
Comments
In order to process this issue image-rs#116
Writes the dimension information before the IDAT chunks in the header of the image. This avoids having to manually construct such a chunk which could also violate the order restriction set by the specification. Also adds a utility function which constructs the PixelDimensions from a simple dpi parameter. Addresses part of image-rs#116
There is an addition to the spec that adds support for PQ-encoded HDR images: https://www.w3.org/TR/png-hdr-pq/ . This relies on However adding support for HDR images is probably going to require some API redesign... |
+1 for encoder AND decoder support of text chunks.
Unfortunately, without access to read/write the zTXt chunk, I currently can't use this crate for my needs. |
Hey! Since I am going to use the library (especially the metadata part of it), I'd like to contribute back by working on some of the chunks here. Maybe some guidance on how to approach a PR would be nice, for example for the tEXT chunk. Is the overall goal to add some new struct and a field to |
That sounds logical to me (but note that I'm not a maintainer). You could still wonder if you want to provide the chunk data without processing, or if you want to decompress the text during decoding. Getting decompressed data would be nice, but might allow malicious PNGs to contain small compressed text that expands to large amounts of memory. For that reason, it might be wise to store the data compressed in the info struct, and provide an easy interface to perform the decompression as needed. That also prevents spending time and memory on decompression when the application doesn't care about the text chunk. |
Currently the encoder lacks built-in support for writing metadata chunks, you can do it manually with
Writer::write_chunk
. However I believe that there should be a nicer high-level way of doing this.pHys
pixel density (in progress Yet another PR like #122 #124)tRNS
TransparencycHRM
Primary chromaticities and white point (Gamma encoding/decoding #243)gAMA
Image gamma (Gamma encoding/decoding #243)iCCP
Embedded ICC profilesBIT
Significant bitssRGB
Standard RGB colour space (Add support for the sRGB chunk. #260)tEXT
Textual datazTXt
Compressed textual dataiTXt
International textual databKGD
Background colourhIST
Image histogramsPLT
Suggested palettetIME
Image last-modification timeNot all of these are equally important, however it would be nice to have support for all of them. See https://www.w3.org/TR/2003/REC-PNG-20031110/#11Ancillary-chunks for specifications on what the chunks should look like.
See also image-rs/image#911
The text was updated successfully, but these errors were encountered: