Skip to content

BMP RLE error or support? #20

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

Closed
fionawhim opened this issue Aug 15, 2019 · 1 comment · Fixed by #21
Closed

BMP RLE error or support? #20

fionawhim opened this issue Aug 15, 2019 · 1 comment · Fixed by #21

Comments

@fionawhim
Copy link
Contributor

Hi! I ran into a problem where ImageMagick’s convert was generating RLE-compressed BMP images, which were then displaying as garbage when I loaded them.

Would you accept a PR that either:

  • Added support for loading an RLE-compressed image
  • Raised an Error if it detected an RLE-compressed image (similar to how it errors on "true color" BMPs now)

I’m happy to provide either.

@matt-land
Copy link
Contributor

Hi Fiona,

Thanks for your interest. We would prefer the former but would accept either.
In addition, if would help us if you can provide two sample images in the RLE-compressed format.

The first image would normally be a "large" image (320x240 max) that can be used by one of the maintainers to manually test your code on hardware. If decompression of this new image type is CPU intense (aka it takes longer than a minute to load), make it smaller.

The second image file should be smaller, about 16x16. It will be used for building an automated regression test ( make sure future commits never accidentally break your code). You do not have to write the automated test.

Please provide download links for the two images in the PR message.

On our end, the process normally takes a few days from "I've opened a PR and my build is passing" for someone to review it, test it on hardware, and merge. After that, a release will be created with the new functionality.

Any other questions, feel free to ask.

fionawhim added a commit to fionawhim/Adafruit_CircuitPython_ImageLoad that referenced this issue Aug 17, 2019
Fixes adafruit#20

RLE compression is allowed on 4-bit and 8-bit BMP images. This commit adds
handling for compression levels 1 and 2.

It adds 2 tiny test files for the 4-bit and 8-bit depths, since the
algorithm differs slightly between them. It also includes a version
of the color_wheel.bmp encoded with 8-bit RLE. I cut the image in half
horizontally so that it would load on the PyGamer, which couldn't
allocate the full Bitmap (presumably due to heap fragmentation).
fionawhim added a commit to fionawhim/Adafruit_CircuitPython_ImageLoad that referenced this issue Aug 22, 2019
Fixes adafruit#20

RLE compression is allowed on 4-bit and 8-bit BMP images. This commit adds
handling for compression levels 1 and 2.

It adds 2 tiny test files for the 4-bit and 8-bit depths, since the
algorithm differs slightly between them. It also includes a version
of the color_wheel.bmp encoded with 8-bit RLE. I cut the image in half
horizontally so that it would load on the PyGamer, which couldn't
allocate the full Bitmap (presumably due to heap fragmentation).
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 a pull request may close this issue.

2 participants