Palette sort does not sort after color invasion
Environment/Versions
- GIMP version: 2.99.18, present in GIMP_2_99_18-391-g167066a4
- Package: Flatpak and installed from source
- Operating System: Linux
Description of the bug
Found when debugging translatability issues in python scripts:
Palette sort on git master errors out without sorting the palettes. Error log at bottom.
GIMP_2_99_16-1200-gf6ff7321 before color invasion worked. Could then also see that sorting by red and blue used to give the same result, so 167066a4 was a nice fix.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Palette Menu->Sort palette
- Choose a palette and a channel
- Errors
…
Expected result: Palette getting sorted according to chosen channel
Actual result: Python error
Additional information
(python-fu-palette-sort:133453): LibGimp-WARNING **: 20:07:26.648: _gimp_procedure_run_array: no return values, shouldn't happen
/usr/local/lib/x86_64-linux-gnu/gimp/2.99/plug-ins/palette-sort/palette-sort.py:508: Warning: g_error_new: assertion 'domain != 0' failed
Gimp.main(PaletteSort.__gtype__, sys.argv)
Procedure 'python-fu-palette-sort': duplicate mnemonic a for label of property ascending1 and dialog button cancel
Procedure 'python-fu-palette-sort': duplicate mnemonic p for label of properties pchannel and palette
Traceback (most recent call last):
File "/usr/local/lib/x86_64-linux-gnu/gimp/2.99/plug-ins/palette-sort/palette-sort.py", line 496, in run
new_palette = palette_sort(palette, selection, slice_expr, channel1, ascending1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/x86_64-linux-gnu/gimp/2.99/plug-ins/palette-sort/palette-sort.py", line 276, in palette_sort
entry_list = get_colors(0, num_colors)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/x86_64-linux-gnu/gimp/2.99/plug-ins/palette-sort/palette-sort.py", line 266, in get_colors
palette.entry_get_color(i)[1])
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'Color' object is not subscriptable