Skip to content

Change: Allow loading of indexed images with linear precision.

Jacob Boerema requested to merge wip/wormnest/issue-6886 into master

Since my knowledge of linear/non linear precision and how that interacts with indexed images is limited, I thought it better to open a MR first.

With the changes here all the png images from issue #6886 (closed) load. A short look at Babl seemed to confirm that it supports linear indexed images but it would probably be good that someone with a better understanding in this area had a look.

Although all images from that issue load individually, I do get a crash in Babl when I run my import test plug-in and try to import all images from the png suite one after the other.

After a while it crashes with this error:

../../babl/babl/babl-internal.h:222 babl_fatal()
        babl_model_from_id(1005): not found
Het systeem kan het opgegeven pad niet vinden. [Translation: The system can't find the specified path.]

(script-fu.exe:38280): LibGimpBase-WARNING **: 17:37:25.806: script-fu.exe: gimp_wire_read(): error

(gimp-file-plugin-tests.py:1268): LibGimpBase-WARNING **: 17:37:25.806: gimp-file-plugin-tests.py: gimp_wire_read(): error

(file-png.exe:21696): LibGimpBase-WARNING **: 17:37:25.806: file-png.exe: gimp_wire_read(): error

I am thinking this error is related to Babl issue babl#60.

I manually computed the hash of 1005 (see babl/babl-db.c function _babl_hash_by_int. If I didn't make a mistake the hash of that would be 0x10c45d8878, which is more than 32 bits.

--

This fixes #6886 (closed) where certain indexed png images fail to load.

As far as I can see babl supports loading of indexed linear precision images, so lets change the checks that prohibited loading of these images.

Also add a console error when precision is not U8 for GIMP_INDEXED.

The png image where it crashes loads without problem when I load it manually, which makes me think this is an unrelated issue not directly caused by my changes.

Merge request reports