Repository navigation
Remove conditionally-compiled or unreachable debug C code #9915
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
Changes from all commits
9e5ea41
b188354
73fd5e3
21169a7
e6de1f0
050d4f9
e1fcb17
bc7c174
8e01610
adeb09c
445bd70
1ffd186
1f96567
f0944e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,33 +156,7 @@ ImagingNewDIB(const ModeID mode, int xsize, int ysize) { | |
|
|
||
| dib->palette = CreatePalette(pal); | ||
| } else if (mode == IMAGING_MODE_RGB) { | ||
| #ifdef CUBE216 | ||
|
|
||
| /* Colour DIB. Create a 6x6x6 colour cube (216 entries) and | ||
| * add 20 extra graylevels for best result with grayscale | ||
| * images. */ | ||
|
|
||
| i = 10; | ||
| for (r = 0; r < 256; r += 51) { | ||
| for (g = 0; g < 256; g += 51) { | ||
| for (b = 0; b < 256; b += 51) { | ||
| pal->palPalEntry[i].peRed = r; | ||
| pal->palPalEntry[i].peGreen = g; | ||
| pal->palPalEntry[i].peBlue = b; | ||
| i++; | ||
| } | ||
| } | ||
| } | ||
| for (r = 1; r < 22 - 1; r++) { | ||
| /* Black and white are already provided by the cube. */ | ||
| pal->palPalEntry[i].peRed = pal->palPalEntry[i].peGreen = | ||
| pal->palPalEntry[i].peBlue = r * 255 / (22 - 1); | ||
| i++; | ||
| } | ||
|
|
||
| #else | ||
|
|
||
| /* Colour DIB. Alternate palette. */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was your thinking behind removing 'Alternate palette'?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted above in #9915 (comment) – never documented, never mentioned otherwise in Git history, you'd have to compile PIL from source on Windows to use this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And for the phrasing... well, it's not "alternative" because there's no alternative anymore?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I wasn't sure what the 'alternate' was referring to, but your thinking is that it referred to CUBE216. Fair enough, thanks. |
||
| /* Colour DIB. */ | ||
|
|
||
| i = 10; | ||
| for (r = 0; r < 256; r += 37) { | ||
|
|
@@ -196,8 +170,6 @@ ImagingNewDIB(const ModeID mode, int xsize, int ysize) { | |
| } | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| dib->palette = CreatePalette(pal); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this can never be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I've trawled through the Git history, it has never been set. You would've needed to know about this undocumented preprocessor variable, and compiled the library with it by hand, to get a different automatic palette for DIB exports.
The obvious way is to convert your RGB image to
Pmode in Pillow code with a palette of your heart's desire, and then DIB it, rather than have this code (from PIL 1.1.1, Oct 20 2000, if my archaeology is correct) guess a palette.