Skip to content

Remove padding between interleaved PCX palette data#9005

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:pcx_padding
Jun 11, 2025
Merged

Remove padding between interleaved PCX palette data#9005
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:pcx_padding

Conversation

@radarhere
Copy link
Copy Markdown
Member

Resolves #8952

#535 added code to remove padding between bands.

for (i = 1; i < bands; i++) { // note -- skipping first band
memmove(
&state->buffer[i * state->xsize],
&state->buffer[i * stride],
state->xsize
);
}

However, that didn't consider that there might be padding between lines for interleaved data, like the P;4L image from the issue.

I've created the test image using Pillow and manual hexediting.

Copy link
Copy Markdown
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thanks!

@hugovk hugovk merged commit 8ccdc39 into python-pillow:main Jun 11, 2025
75 of 76 checks passed
@radarhere radarhere deleted the pcx_padding branch June 11, 2025 13:20
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.

Loaded PCX image has smeared result

2 participants