Skip to content

Removed PPM loop to read header tokens#7698

Merged
hugovk merged 3 commits intopython-pillow:mainfrom
radarhere:ppm
Jan 9, 2024
Merged

Removed PPM loop to read header tokens#7698
hugovk merged 3 commits intopython-pillow:mainfrom
radarhere:ppm

Conversation

@radarhere
Copy link
Member

PpmImagePlugin is structured to read each of the header tokens one at a time, and then perform an action with it.

for ix in range(3):
token = int(self._read_token())
if ix == 0: # token is the x size

It's simpler and shorter to remove the loop.

@hugovk hugovk merged commit 605e664 into python-pillow:main Jan 9, 2024
@radarhere radarhere deleted the ppm branch January 9, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants