Skip to content

If TGA v2 extension area specifies no alpha, fill alpha channel#9478

Open
radarhere wants to merge 1 commit intopython-pillow:mainfrom
radarhere:tga_alpha
Open

If TGA v2 extension area specifies no alpha, fill alpha channel#9478
radarhere wants to merge 1 commit intopython-pillow:mainfrom
radarhere:tga_alpha

Conversation

@radarhere
Copy link
Member

Resolves #9473

Using https://www.fileformat.info/format/tga/egff.htm as a reference, I found that v2 TGA files may has a 26 byte footer at the end of the file. The first 4 bytes point to the 'extension area', the last byte of which is 'AttributesType'. If this is zero, then the file should not has any alpha.

To avoid seeking to the end of the file during open), I'm only checking this value in load_end(), and filling the alpha channel at that point.

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.

Transparent images don't seem to be handled correctly

1 participant