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

Fix encoding PNG file with alpha channel on macOS #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fang-ling
Copy link

When encodes a png file with alpha channel (i.e. Export a png file with default setting from macOS's Preview.app), the library has a bug as you can see in #57.

I managed to fix this by first converting the NSImage to CGImage with RGBA, then converting CGImage to webP data.

We do so by first convert the NSImage to CGImage, then call the WebP APIs.
@Kyome22
Copy link

Kyome22 commented Nov 17, 2024

@fang-ling @fang-ling
I have confirmed the operation of this PR.
It's working perfectly. The issue #57 is also resolved.

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