Skip to content

Conversation

radarhere
Copy link
Member

A few ImageFont._load_pilfont_data() suggestions.

  1. Remove an unnecessary split()
    file.readline().split(b";")
  2. Check image mode before reading from file, to return the error faster.
  3. Rather than potentially reading an entire line,
    if file.readline() != b"PILfont\n":

    we can limit the length of the read operation by just using read(8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant