Skip to content

OTA Bitmap encoding/decoding likely incorrect when width % 8 != 0 #27

@mstoeckl

Description

@mstoeckl

The current image-extras encoder and decoder for the OTA Bitmap format appears to incorrectly handle (rare) images whose width is not a multiple of 8.

Quoting the description of MR introducing the format: #2:

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 have not been able to find any example OTA Bitmap images which are not 72 pixels wide, but the specification for OTA Bitmap (the Smart Messaging Specification 3.0.0, Section 3.7, indirect link) agrees with Wikipedia. The relevant line:

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.

I only found one non-ImageMagick implementation handling images with width not divisible by 8, in Kannel; matching the spec, it only pads at the end of image and not at the end of the rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions