Skip to content

Commit 6dba1ad

Browse files
authored
Merge pull request #2608 from pygame-community/ankith26-document-xcf
Test PBM and LBM images, test and document XCF
2 parents c6d6257 + 5fca462 commit 6dba1ad

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

docs/reST/ref/image.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ formats.
2727

2828
* ``JPEG``
2929

30-
* ``LBM`` (and ``PBM``, ``PGM``, ``PPM``)
30+
* ``LBM``
3131

3232
* ``PCX``
3333

3434
* ``PNG``
35-
36-
* ``PNM``
35+
36+
* ``PNM`` (``PBM``, ``PGM``, ``PPM``)
3737

3838
* ``QOI``
3939

@@ -46,8 +46,9 @@ formats.
4646
* ``WEBP``
4747

4848
* ``XPM``
49-
50-
49+
50+
* ``XCF``
51+
5152
.. versionaddedold:: 2.0 Loading SVG, WebP, PNM
5253

5354
.. versionadded:: 2.4.0 Loading QOI (Relies on SDL_Image 2.6.0+)

examples/data/magenta.lbm

190 Bytes
Binary file not shown.

examples/data/tomato.xcf

693 Bytes
Binary file not shown.

examples/data/white.pbm

183 Bytes
Binary file not shown.

test/image_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,14 +1758,20 @@ def test_load_extended(self):
17581758
("purple.xpm", (255, 0, 255, 255)),
17591759
("black.ppm", (0, 0, 0, 255)),
17601760
("grey.pgm", (120, 120, 120, 255)),
1761+
("white.pbm", (255, 255, 255, 255)),
17611762
("teal.svg", (0, 128, 128, 255)),
17621763
("crimson.pnm", (220, 20, 60, 255)),
17631764
("scarlet.webp", (252, 14, 53, 255)),
1765+
("tomato.xcf", (255, 99, 71, 255)),
17641766
]
17651767

17661768
if pygame.image.get_sdl_image_version() > (2, 0, 5):
17671769
filename_expected_color.append(("purple.qoi", (159, 38, 240, 255)))
17681770

1771+
# SDL_image 2.8.0 and 2.8.1 have an LBM file loading regression
1772+
if not (2, 8, 0) <= pygame.image.get_sdl_image_version() < (2, 8, 2):
1773+
filename_expected_color.append(("magenta.lbm", (255, 0, 255, 255)))
1774+
17691775
for filename, expected_color in filename_expected_color:
17701776
if filename.endswith("svg") and sdl_image_svg_jpeg_save_bug:
17711777
# SDL_image 2.0.5 and older has an svg loading bug on big

0 commit comments

Comments
 (0)