Skip to content

Conversation

reshane
Copy link

@reshane reshane commented Feb 6, 2025

Related to Issue #1

Switched the image patch to my own fork to add the Wbmp & Otb formats to the image::ImageFormat enum so the hooks would register. Not exactly sure the best course of action to add the formats - whether to open a PR for the formats now, wait for the decoding-hooks branch to be merged, etc. guidance appreciated 😃

Note that OTA Bitmap Wikipedia article differs from ImageMagick implementation for the format (ImageMagick splits rows at bytes - padding with 0s, while Wikipedia explicitly claims this is not the case). (OTA Bitmap Wiki, ImageMagick implementation)
I have gone with an implementation consistent with ImageMagick, but the implementation consistent with the Wikipedia is easier, so if there is any evidence that the latter is valid I would be happy to switch it back.

I had some trouble finding otb / wbmp images with explicit licenses, so I drew the test images which is why there is no source listed for them.

@mstoeckl
Copy link
Contributor

mstoeckl commented Oct 5, 2025

Not exactly sure the best course of action to add the formats - whether to open a PR for the formats now, wait for the decoding-hooks branch to be merged, etc. guidance appreciated 😃

The main image crate has recently had a release (0.25.8) adding a decoding hooks API.

I have gone with an implementation consistent with ImageMagick, but the implementation consistent with the Wikipedia is easier, so if there is any evidence that the latter is valid I would be happy to switch it back.

I think Wikipedia is right. Quoting the Smart Messaging Specification 3.0.0 (linked from https://web.archive.org/web/20161016190953/http://fileformats.archiveteam.org/wiki/OTA_bitmap), Section 3.7:

In order to fully utilise the available bandwidth no filler bits are used in the end of the row; fillers are put at the end of the whole bitmap if the size of the bitmap is not divisible by eight. Filler bits assume a value of zero.

Also, WBMP and OTB look like they are quite rare formats nowadays; if you don't mind me asking, what are you decoding and encoding them for?

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.

2 participants