Additional fields in ModeData structure by wiredfool · Pull Request #9274 · python-pillow/Pillow

@wiredfool

Changes proposed in this pull request:

  • Additional hoisting of data from Storage.c into the const ModeData structure.
  • Perf: Don't strcpy the band names and arrow format in for every new image.

Still considering --

  • Should we leave the fields in the Image header? We can copy ints, we can copy addresses.
  • Should we just have a pointer to the mode struct? This makes more changes across the code base.

@wiredfool

@wiredfool

* Just copy these in because they're ints
* Calculate the line size, because it's just pixelsize * xsize

@pre-commit-ci

@radarhere

Should we just have a pointer to the mode struct? This makes more changes across the code base.

Could you clarify for me, what was the motivation behind the mode struct in the first place (#9256)? I thought it was primarily preparing the way for other field to be moved in there as well. Or was the theory that it would run strcmp less?

@radarhere

@pre-commit-ci