Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
GIMP
GIMP
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,677
    • Issues 2,677
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 35
    • Merge Requests 35
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • GIMPGIMP
  • Issues
  • #5852

Closed (duplicated)
Open
Opened Oct 30, 2020 by Cave Salamander@cave.salamander

Wrong biCompression value in exported uncompressed 8 bit bmp ?

GIMP version: 2.10.22 Operating System: Windows Package: Installer from gimp.org

Description of the bug

When I export uncompressed 8-bit bmp I see biCompression field value 3 (BI_BITFIELDS) in bmp header.

According to "2.1.1.7 Compression Enumeration" on https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4e588f70-bd92-4a6f-b77f-35d0feaf7a57

typedef enum { BI_RGB = 0x0000, BI_RLE8 = 0x0001, BI_RLE4 = 0x0002, BI_BITFIELDS = 0x0003, BI_JPEG = 0x0004, BI_PNG = 0x0005, BI_CMYK = 0x000B, BI_CMYKRLE8 = 0x000C, BI_CMYKRLE4 = 0x000D } Compression;

BI_RGB: The bitmap is in uncompressed red green blue (RGB) format that is not compressed and does not use color masks.

BI_BITFIELDS: The bitmap is not compressed, and the color table consists of three DWORD (defined in [MS-DTYP] section 2.2.9) color masks that specify the red, green, and blue components, respectively, of each pixel. This is valid when used with 16 and 32-bits per pixel bitmaps.

My bmp has 8 bits per pixel, so using BI_BITFIELDS in this case looks incorrect. I'm definitely not expert in this area; usually (from my practice) this field has value 0 (BI_RGB).

Reproduction

Is the bug reproducible? Always

Reproduction steps:

  1. Open 8 bit bmp.
  2. Export into bmp without compression.
  3. Check value in exported file.

Expected result: 0 (BI_RGB) Actual result: 3 (BI_BITFIELDS)

Additional information

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/gimp#5852