Skip to content
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

BMP: support RLE decompression (8bit/4bit) #26

Open
cfcs opened this issue Jun 21, 2019 · 0 comments
Open

BMP: support RLE decompression (8bit/4bit) #26

cfcs opened this issue Jun 21, 2019 · 0 comments

Comments

@cfcs
Copy link
Collaborator

cfcs commented Jun 21, 2019

The compression methods seem to be documented at least somewhat here:

I see imagemagick using these compression methods, so maybe it would make sense to implement them if someone feels like it on a rainy day. :)

@@ -249,8 +251,10 @@ module BitmapMetaData = struct
     let compression_method_of_int n =
       match n with
       | 0 -> Ok RGB
+      | 1 -> Ok RLE_8bit
+      | 2 -> Ok RLE_4bit
       | 3 -> Ok Bitfields
-      | _ -> Error (`Bmp_error "Invalid compression method")
+      | u -> Error (`Bmp_error (Printf.sprintf "Invalid compression method %#x" u))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant