Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Fix indices of colors read from GIMP Palette file

Open jsbueno opened this issue 3 years ago • 2 comments

Fixes #6639

Changes proposed in this pull request:

  • Do not count non-color lines (headers and comments) in the Palette file as color indexes
  • Annotate the total number of read colors in the GimpPaletteFile instance
  • Update tests accordingly
  • Rename color names in the sample palette file to match the indexes actually present in the file.

jsbueno avatar Oct 04 '22 04:10 jsbueno

[WIP] - modifying to allow reading > 256 colors

jsbueno avatar Oct 06 '22 13:10 jsbueno

Regarding the line size limit, I expect the original intention of the 100 character limit was to pick an unreasonably high number, so that if it was being exceeded, then something was wrong, or an attack was occurring.

You have a different opinion, that we should support, at least through configuration, all theoretically possible files. Because of the large number of users who pass through this repository with requests, I have a concern about Pillow becoming overly complex. If no one would actually benefit, I'm reluctant to complicate the API further. Overall, I think that three attributes to control reading limits for one plugin is complicated.

Regarding the color limit, as I've said, I'm reluctant to do so, as I don't want to mislead users into thinking that they have a palette that can be used without a problem elsewhere in Pillow.

radarhere avatar Oct 19 '22 10:10 radarhere