Skip to content

Conversation

@mstoeckl
Copy link
Contributor

@mstoeckl mstoeckl commented Nov 5, 2025

This PR adds a minimal OpenRaster decoder that just checks the file format and decodes the mergedimage.png composite image. (OpenRaster images are ZIP files that contain PNG layers, an XML file describing how to compose the layers, a thumbnail image, and a composite image.) The format is specified at https://www.openraster.org/baseline/file-layout-spec.html and is supported by ImageMagick.

I created the test image and license it to match image-extras. In general, multi-layer OpenRaster files can be exported by Krita and Gimp.

This is marked as a draft for now, because register_decoding_hook has no way to specify the encoding limits in advance, and I am still thinking about how best to handle this on the image side. (Probably by adding image::hooks::register_decoding_hook_with_limits...)

This adds an (optional) dependency on the relatively complicated zip crate and ouroboros. These dependencies could be avoided with a few hundred to thousand lines of code to scan the ZIP headers and extract the relevant subfiles -- the OpenRaster spec only permits basic (deflated, stored) ZIP compression methods, so directly parsing it is not impossible if the zip crate proves too inflexible.

This is fourth on the list of formats I would like image-extras to support (XPM>XBM>SGI>ORA), since I don't really run into this file type in practice (I mostly made this PR to see how it exercises the image crate's abstractions, at which point making it usable wasn't too much work).

@mstoeckl mstoeckl changed the title Draft: add OpenRaster (*.ora) decoder Draft: Add OpenRaster (*.ora) decoder Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant