gimp_buffer_get_image_type(): doc says returns GimpImageBaseType, should say GimpImageType
Environment/Versions
- GIMP version: 2.99 but probably affects 2.10
- Package: self-built
- Operating System: Linux
Description of the bug
Documentation error.
Reproduction
Reproduction steps:
- Read PDB Browser under gimp-buffer-get-image-type, see type of the return value is "GimpImageBaseType"
- Open an RGB image
- Edit>Buffer>Copy Named... see a dialog, enter "foo" and choose OK
- In SF Console, enter (gimp-buffer-get-image-type "foo") and hit return
- Expect to see "(1)"
But the doc in the PDB Browser says 1 is "Gray", because the doc names the wrong type. …
Additional information
I think the fix is, in /pdb/groups/buffer.pdb line 216 change 'enum GimpImageBaseType' to GimpImageType.
That is, the implementation (calling gimp_babl_format_get_image_type ) is correct, but the toolchain (C compiler, or pdbgen) is not really distinguishing enum types and treats them all as ints.
Low priority, I only discovered this while reading. An actual test passes, if it uses a constant from GimpImageType:
(= (gimp-buffer-get-image-type "foo")
RGBA-IMAGE)
Its kind of strange that an image has imagebasetype RGB and its layers don't have an alpha channel but a buffer copied from the image has imagetype RGBA-IMAGE and has bpp of 4.