Skip to content

Strange image shift in .bmp files #5246

@flozirkus

Description

@flozirkus

What did you do?

I opened a *.bmp file which i converted via Dataray WCF File Converter.

What did you expect to happen?

Show the file as it appears in MS Paint, MS Photo App or Affinity Photo.

What actually happened?

The content is shifted by approximately 160 pixels to the left. Missing pixels are added to the right side (seems like the image was cut in two pieces and the left part was added on the right side). The image format matches (width and height). No error was given.
I also tested the files with XnView, Irfanview and Gimp and they all show the same strange behaviour.

What are your OS, Python and Pillow versions?

  • OS: Windows 20H2
  • Python: Python 3.7.9
  • Pillow: Pillow 8.0.1
    testfiles.zip
# -*- coding: utf-8 -*-
"""
Created on Tue Dec  8 13:54:54 2020

@author: HLO
"""
import os
from PIL import Image, ImageShow

demo = Image.open(os.path.join("0.bmp")
ImageShow.show(demo)

Annotation: My python code contains more stuff, but this example is enough to see the misbehaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions