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

Large stickers lose their transparency when sent #6447

Open
Amzd opened this issue Jan 18, 2025 · 3 comments
Open

Large stickers lose their transparency when sent #6447

Amzd opened this issue Jan 18, 2025 · 3 comments
Labels
bug Something is not working

Comments

@Amzd
Copy link

Amzd commented Jan 18, 2025

In iOS 17+ you can select a subject in a photo and drag it out as a sticker. When copying or dragging these they are not resized so if the image was massive, the sticker will be massive.

When pasted into delta chat, we can natively detect that it has transparent corners and send it as sticker. Now when I send a sticker that is too big, core resizes it and it loses transparency and gains a black background. Preferably the sticker would be resized by core without losing transparency. If that is out of scope for core we can resize natively in iOS.

  • Operating System: iOS 17
  • Delta Chat Version: master
  • Expected behavior: Stickers are resized without transparency loss
  • Actual behavior: Stickers gain black background
  • Steps to reproduce the problem: Drag (or copy) a subject from a large image to Delta Chat
  • Screenshots:

Image
image

  • Logs:
@link2xt
Copy link
Collaborator

link2xt commented Jan 18, 2025

First thing I want to know is if this is still sent as a sticker viewtype or gets converted to image by heuristics.
For some history regarding sticker heuristics:

If it is sent as a sticker, then the only bug is that it converts to JPEG instead of resizing the image as PNG which can preserve transparency.

@link2xt link2xt added the bug Something is not working label Jan 18, 2025
@Amzd
Copy link
Author

Amzd commented Jan 18, 2025

It is sent as view type DC_MSG_STICKER on iOS

@r10s
Copy link
Contributor

r10s commented Jan 21, 2025

then the only bug is that it converts to JPEG instead of resizing the image as PNG which can preserve transparency.

if goal is to have small byte sizes, this is not a bug. JPG is often at least a magnitude smaller than (even optimized) PNG, see #3956 (comment) and #4037 (comment)

ftr, the arguably too large stickers resulting from iOS-auto-generated-drag-from-gallery are scaled down on iOS at deltachat/deltachat-ios#2535 - so, well, maybe we should just stop changing stickers in core.

so, tbh, not sure, what do here. the iOS issue seems to be fixed. and tweaking things again might result in new bugs, might totally be we did not consider all cornercases, at least i cannot say i have a good overview 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

3 participants