vonderheide / mono-bitmap

node.js package to create in-memory grayscale or color bitmaps
MIT License
12 stars 3 forks source link

Incorrect offset when opening BMP saved in GIMP #8

Open clydeshaffer opened 2 months ago

clydeshaffer commented 2 months ago

When opening a BMP file saved in GIMP it looks like the header is not interpreted correctly, causing it to read pixel data too early in the file. The same BMP file is fixed when opening it and re-saving it in Aseprite.

track_bmps.zip

clydeshaffer commented 2 months ago

Here's a minimal repro use case

const BMP = require('bitmap-manipulation');

let imageFromGIMP = BMP.BMPBitmap.fromFile("track_gimp.bmp");
imageFromGIMP.save("gimp_out.bmp");

let imageFromAseprite = BMP.BMPBitmap.fromFile("track_aseprite.bmp");
imageFromAseprite.save("aseprite_out.bmp");

After investigating further with the original issue reporter, the GIMP files will be read correctly if they were exported with the "Do not write color space information" option selected under Compatibility.