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 webp support #346

Merged
merged 6 commits into from
Oct 6, 2021
Merged

Add webp support #346

merged 6 commits into from
Oct 6, 2021

Conversation

apmechev
Copy link
Contributor

@apmechev apmechev commented Sep 11, 2021

adds logic in portal.go to convert webP images to png, since WebP images don't seem to work Matrix -> WhatsApp

uses golang.org/x/image/webp to do the conversion in memory
Can be tested using apmechev/mautrix-whatsapp-test:v0.2.4-4 from dockerhub

@apmechev
Copy link
Contributor Author

If you need to test it, you can use
https://hub.docker.com/r/apmechev/mautrix-whatsapp-test

Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

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

This should use a native Go library like golang.org/x/image/webp for decoding the webp (and re-encoding as png), there's no need for external tools.

gif -> mp4 only uses ffmpeg because animation is a lot more complicated than static images.

@apmechev
Copy link
Contributor Author

Updated to use golang.org/x/image/webp and forgo writing to the filesystem

@apmechev
Copy link
Contributor Author

apmechev commented Oct 6, 2021

Hey, does this look good?
I was also thinking of adding webM support using ffmpeg but I was going to do it in another PR

Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

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

Fixed the variable names (Go uses camelCase)

Looks good, thanks!

@tulir tulir merged commit 9ca18ea into mautrix:master Oct 6, 2021
@apmechev apmechev deleted the AddWebpSupport branch October 7, 2021 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants