-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Custom GIF emoji - alpha color v2 #16370
Comments
#10351 has useful context; debugging this will likely involve spending some type looking at Pillow and debugging, and potentially reporting an upstream bug. @HarshitOnGitHub did this with the previous iteration of this sort of bug, and may have some context as well. |
@alfonsrv @timabbott can you help me reproduce this bug as this seems to be working fine with me. |
@akshatdalton
In the preview pane you should now see the same result as shown above. Not sure what you're doing, but this clearly doesn't seem like an upload to Zulip, as it would cut off the sides of the Nice-GIF in the current way Zulip handles GIF conversion, as outlined above. |
I am working on this issue. |
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes zulip#16370 (partially).
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of zulip#16370.
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of zulip#16370.
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of #16370.
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of zulip#16370.
This preserves the alpha layer on GIF images that need to be resized before being uploaded. Two important changes occur here: 1. The new frame is a *copy* of the original image, which preserves the GIF info. 2. The disposal method of the original GIF is preserved. This essentially determines what state each frame of the GIF starts from when it is drawn; see PIL's docs: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#saving for more info. This resolves some but not all of the test cases in #16370.
Several classes of this form of issue were fixed in #16456 thanks to excellent work by @codypiersall; the remaining ones appear to be an upstream PIL bug (which we should link here once it's filed). |
This preserves the alpha layer on GIF images that need to be resized before being uploaded. Two important changes occur here: 1. The new frame is a *copy* of the original image, which preserves the GIF info. 2. The disposal method of the original GIF is preserved. This essentially determines what state each frame of the GIF starts from when it is drawn; see PIL's docs: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#saving for more info. This resolves some but not all of the test cases in zulip#16370.
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of zulip#16370.
This preserves the alpha layer on GIF images that need to be resized before being uploaded. Two important changes occur here: 1. The new frame is a *copy* of the original image, which preserves the GIF info. 2. The disposal method of the original GIF is preserved. This essentially determines what state each frame of the GIF starts from when it is drawn; see PIL's docs: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#saving for more info. This resolves some but not all of the test cases in zulip#16370.
This preserves the alpha layer on GIF images that need to be resized before being uploaded. Two important changes occur here: 1. The new frame is a *copy* of the original image, which preserves the GIF info. 2. The disposal method of the original GIF is preserved. This essentially determines what state each frame of the GIF starts from when it is drawn; see PIL's docs: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#saving for more info. This resolves some but not all of the test cases in zulip#16370.
Reopening because the issue hasn't been fixed. Some recent discussion in chat. |
As per #10351, the error still occurs with Zulip 3.2. Uploading custom emojis GIFs results in unexpected behavior. Turning on or off the
optimize=
flag does not change anything about it.Example: uploading a Giphy sticker, mostly results in a black background – here, on the official Zulip server.
, ref
Side note: It would also be nice if extra padding was added to the top and bottom to convert the image to 1:1 ratio rather than cut it off.
Another artifact I encountered was uploading another sticker, resulting in not only a black background but also some other artifacts.
, ref
The text was updated successfully, but these errors were encountered: