Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearranged code #108

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/PIL/ImagePalette.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ def raw(rawmode, data):


def make_linear_lut(black, white):
if black == 0:
return [white * i // 255 for i in range(256)]
if black != 0:
msg = "unavailable when black is non-zero"
raise NotImplementedError(msg) # FIXME
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the error message "unavailable when black is non-zero", this seems more natural to me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I prefer the original, try the success case first.


msg = "unavailable when black is non-zero"
raise NotImplementedError(msg) # FIXME
return [white * i // 255 for i in range(256)]


def make_gamma_lut(exp):
Expand Down