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

Edit profile page crashes when trying to set WebP file as profile image #11536

Closed
imbsky opened this issue Aug 11, 2019 · 6 comments

Comments

@imbsky
Copy link
Contributor

commented Aug 11, 2019

Expected behaviour

If we really support WebP file, we should be able to set it as profile image.

Actual behaviour

It shouldn't crash.

Steps to reproduce the problem

After set WebP file as avatar or header image, press the save changes button.

Specifications

  • Mastodon version: latest master
  • OS: macOS 10.14.6
  • Browser: Chrome 76.0.3809.87
@angristan

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

The edit profile page says:

PNG, GIF or JPG. At most 2 MB. Will be downscaled to 400x400px

So yeah, it should either really support webp or reject it without crashing 🤔

@angristan

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

It crashes beaucase:

Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] Command :: file -b --mime '/tmp/1c48b7459dc9291c12b8a93b4857a41820190816-363-1gs8gux.webp'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] Command :: identify -format %m '/tmp/1c48b7459dc9291c12b8a93b4857a41820190816-363-aca78l.webp[0]'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] method=PUT path=/settings/profile format=html controller=Settings::ProfilesController action=update status=500 error='Paperclip::Error: There was an error running `identify` for 1c48b7459dc9291c12b8a93b4857a41820190816-363-aca78l' duration=424.26 view=0.00 db=3.61
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae]
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] Paperclip::Error (There was an error running `identify` for 1c48b7459dc9291c12b8a93b4857a41820190816-363-aca78l):
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae]
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] lib/paperclip/lazy_thumbnail.rb:17:in `make'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] app/services/update_account_service.rb:8:in `call'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] app/controllers/settings/profiles_controller.rb:19:in `update'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] app/controllers/concerns/localized.rb:18:in `block in set_locale'
Aug 16 22:39:39 mstdn bundle[209]: [de489f24-8ac7-4a83-966b-3980c02be6ae] app/controllers/concerns/localized.rb:17:in `set_locale'

This can be fixed by installing the webp package, as reported by #11538.

Even after the new avatar is set, this does not display:

Screenshot 2019-08-16 at 22 41 07

So yeah webp is not really supported 🙂

@angristan

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

Looking at the code, webp support has been explicitly added: #9879 #8165

I got curious so I tried to upload a webp as an attachment for a toot, and I got an error

[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>

Is there something I missed as an admin for webp support? Because the webp package doesn't seem to be enough. I'm not sure what's the status of webp on Mastodon.

@Gargron

This comment has been minimized.

Copy link
Member

commented Aug 17, 2019

I misunderstood the level of support for the format since those who requested it said that it was widely supported. Meanwhile, as it turns out, imagemagick does not even identify it without an extra system package, and even with that package still fails on animated webp.

I suggest that we remove the "support" for webp again.

@angristan

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2019

OK. I'm surprised this is the first report about webp, since the PR has been merged 6 months ago and some people were very interested in it (maybe it does work for them?)

@imbsky

This comment has been minimized.

Copy link
Contributor Author

commented Aug 17, 2019

I think it doesn't work unless the sysadmin makes at least a few additional changes beyond the standard installation procedure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.