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

Server can't generate preview images for animated WebP files #26925

Open
mattermod opened this issue Apr 29, 2024 · 1 comment
Open

Server can't generate preview images for animated WebP files #26925

mattermod opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go Server

Comments

@mattermod
Copy link
Contributor

mattermod commented Apr 29, 2024

Originally reported by https://github.com/mattermost/mattermost/issues/26704

Repro steps:

  1. Post one of the animated webps found at webp.zip

Observed: The file can be uploaded and posted as an attachment, but the preview image for it will be blank. With debug logging enabled, errors like the following will be logged on upload and when viewing the post:

{"timestamp":"2024-04-29 14:57:26.650 -04:00","level":"error","msg":"Unable to decode image","caller":"app/file.go:899","path":"/api/v4/files","request_id":"jkky79m8kjnnzet813cundpj1r","ip_addr":"127.0.0.1","user_id":"d8njkgw3yifzjee3bejpkqb8kw","method":"POST","file_name":"panic.webp","error":"imaging: failed to decode image: webp: invalid format"}
{"timestamp":"2024-04-29 14:57:26.871 -04:00","level":"debug","msg":"generateMiniPreview: prepareImage failed","caller":"app/file.go:1192","path":"/api/v4/files/twq74tqr8bdzzxzthxzgfn6kqo/thumbnail","request_id":"za8bydua838adryqweinhzhmzo","ip_addr":"127.0.0.1","user_id":"d8njkgw3yifzjee3bejpkqb8kw","method":"GET","error":"prepareImage: failed to decode image: imaging: failed to decode image: webp: invalid format","fileinfo_id":"twq74tqr8bdzzxzthxzgfn6kqo","channel_id":"piafpookrbgwfmhcm1dao9x8te","creator_id":"d8njkgw3yifzjee3bejpkqb8kw"}
{"timestamp":"2024-04-29 14:57:26.872 -04:00","level":"debug","msg":"Unable to get a file reader.","caller":"web/context.go:111","path":"/api/v4/files/twq74tqr8bdzzxzthxzgfn6kqo/thumbnail","request_id":"za8bydua838adryqweinhzhmzo","ip_addr":"127.0.0.1","user_id":"d8njkgw3yifzjee3bejpkqb8kw","method":"GET","err_where":"FileReader","http_code":404,"error":"FileReader: Unable to get a file reader., unable to open file 20240429/teams/noteam/channels/piafpookrbgwfmhcm1dao9x8te/users/d8njkgw3yifzjee3bejpkqb8kw/twq74tqr8bdzzxzthxzgfn6kqo/panic_thumb.jpg: open data/20240429/teams/noteam/channels/piafpookrbgwfmhcm1dao9x8te/users/d8njkgw3yifzjee3bejpkqb8kw/twq74tqr8bdzzxzthxzgfn6kqo/panic_thumb.jpg: no such file or directory"}

Expected: If possible, a static preview image will be generated for the image

Note: The Go library for WebP files doesn't fully support animated webp files which may make this difficult. If that's not possible, we may have to look at not even generating an image and falling back to treating the file as if it were not an image at all.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-57742

@mattermod mattermod added Help Wanted Community help wanted Up For Grabs labels Apr 29, 2024
@hmhealey hmhealey added Difficulty/2:Medium Medium ticket Tech/Go Server labels Apr 29, 2024
@arman-yekkehkhani
Copy link

Hi, I am interested to contribute. Can I work on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go Server
Projects
None yet
Development

No branches or pull requests

4 participants