etemesi254 / zune-image

A fast and memory efficient image library in Rust
Other
292 stars 29 forks source link

Export `SOFMarkers` enum in `zune-jpeg` #212

Closed reknih closed 1 week ago

reknih commented 2 weeks ago

The ImageInfo struct currently has a field sof of the type SOFMarkers. The SOFMarkers enum is not exported, so consumers of the library cannot use the field.

At Typst, we would like to check the type of the enclosed JPEG. For example, images encoded with SOF0 and SOF1 (compare Adobe Tech Note #5116, p. 8; as well as SOF2 starting from PDF 1.3, see PDF 1.7 spec, p. 35) may directly be included in PDFs, without recoding to a different format. This would make Typst faster and potentially conserve image quality better, depending on if a lossy recoding would have been chosen otherwise. We want to check that the image file isn't in a format that zune-jpeg supports but PDF viewers may not, hence why we want to check the field. It would be great if the enum could be exported!

etemesi254 commented 2 weeks ago

Done, will be available in new release.

Keeping this opened to close it when I make the release

etemesi254 commented 1 week ago

Done in 0.4.13 and 0.5.0-rc2