-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support reading BC4U and DX10 BC1 images #6486
Conversation
Is it possible to make pre-commit.ci not to reformat some parts of the code? |
Yes. There is |
src/PIL/Image.py
Outdated
("offset", int), | ||
("tile_args", Tuple), | ||
], | ||
) |
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.
Could you say a few words about why this is helpful?
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've added it to understand what tile structure is. I didn't found any doc for it, so i scouted sources to understand what everything mean
src/PIL/DdsImagePlugin.py
Outdated
NV12 = 103 | ||
P010 = 104 | ||
P016 = 105 | ||
_420_OPAQUE = 106 |
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.
Just to note - this should be 420_OPAQUE
, but you've prefixed it with an underscore because otherwise Python will throw a SyntaxError.
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.
Is there any better way around this?
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.
No, I don't think so, not while using an enum.
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.
How about OPAQUE_420
? Some might think it's private with a leading underscore.
I extracted the support for single channel images, and it has been merged as PR #6820. |
Awesome! |
Add typing info to Image.tile
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Moved _Tile from Image to ImageFile
A bit offtop. I may work on adding support for PVR textures in some time. I already implemented ETC decoder(one of they compression formats) https://github.com/REDxEYE/TextureDecoder/blob/master/library/src/decoders/etc/etc1.cpp |
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.
Thanks!
Let's also add release notes for this (can be in a followup PR) and retitle the PR for the most important thing ("Add support for ..."?).
src/PIL/DdsImagePlugin.py
Outdated
NV12 = 103 | ||
P010 = 104 | ||
P016 = 105 | ||
_420_OPAQUE = 106 |
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.
How about OPAQUE_420
? Some might think it's private with a leading underscore.
I've retitled the PR, and added release notes. The release notes also cover #7603 |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
docs/releasenotes/10.2.0.rst
Outdated
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
``DDSD``, ``DDSCAPS``, ``DDSCAPS2``, ``DDPF``, ``DXGI_FORMAT`` and ``D3DFMT`` | ||
enums have been added to DdsImagePlugin. |
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.
enums have been added to DdsImagePlugin. | |
enums have been added to py:class:`PIL.DdsImagePlugin`. |
b8aa548
to
306b58a
Compare
306b58a
to
00c6a89
Compare
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Thank you for your patience! This will be in the next release, set for 2nd January 2024. |
Changes proposed in this pull request: