You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Originally reported by https://github.com/mattermost/mattermost/issues/26704
Repro steps:
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:
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
The text was updated successfully, but these errors were encountered: