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

Add partial bindings for plJPEG and plPNG. #291

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Dec 6, 2024

I only included the two most immediately useful things in Python - loading JPEGs and PNGs from a stream into a plMipmap.

These bindings will be useful for Python programs that want to create
mipmaps from JPEGs without round-tripping the image contents though
another library (eg PIL) and getting the Hank Hill hot dog effect.
This is to match `plJPEG::DecompressJPEG()`. It's more useful for
maintaining something like pngcrush compression when importing a PNG
into a PRP.
Copy link
Member

@zrax zrax left a comment

Choose a reason for hiding this comment

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

From the macOS CI failure, it looks like the JPEG and PNG dependencies need to be made public on HSPlasma... Either that, or they should be removed from the public headers.

Looks good otherwise.

This required some work in plJPEG to not use libjpeg structs in the
class itself. I took the opportunity to write some simple RAII helpers
to simplify life.
@zrax zrax merged commit b04ad4a into H-uru:master Dec 6, 2024
10 checks passed
@Hoikas Hoikas deleted the image_roundtrip branch December 7, 2024 00:40
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.

2 participants