-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
GIFs from Gboard are sent as JPEG #6352
Comments
hi @JoeMcNuggets thanks for reporting, I just tried the steps you described but the GIFs look perfectly fine/animated to me and they have the proper .gif file name and mime type: |
so maybe it is about the gboard version you are using? try upgrading, otherwise it is the specific GIFs files you are trying to use, then attach such GIF here so we can reproduce the problem, thanks in advance! 🙏 |
Yep, here's those GIFs:
https://media.tenor.com/kfhNaQpcRokAAAAM/yakuza-goro.gif
https://media.tenor.com/ZFiYeG5v1MQAAAAM/goro-majima.gif
https://media.tenor.com/U5zAnZCFzJcAAAAM/stop-sign-reporter.gif
But this one is just fine
https://media.tenor.com/JZ59uOv1keIAAAAM/%D1%82%D1%80%D0%BE%D0%BB%D0%BB%D1%84%D0%B5%D0%B9%D1%81.gif
On October 7, 2024, Dr Nic Williams ***@***.***> wrote:
so maybe it is about the gboard version you are using? try upgrading,
otherwise it is the specific GIFs files you are trying to use, then
attach such GIF here so we can reproduce the problem, thanks in
advance! 🙏
—
|
thanks I could reproduce now, only if I attach it from Gboard (I searched for "goro majima") but if I directly attach the GIF file using the attachment selector then the gif is sent fine, it seems to be related to the file size, since the GIF is too big it seems Delta Chat core is compressing it and converting it to JPEG, I don't know why it only happens when the image comes from the Gboard keyboard tho, it is likely related to: |
btw, sometimes Gboard says something like "this app does not support pasting gifs". Maybe it can help |
ok, after looking into this, it seems to be a bug in Delta Chat core:
|
I think in general it is better to revert or improve the logic in this area, don't only check for transparency but if image is small enough (dimensions aren't super big ex. > 500px) then it is likely not a screenshot, and then it was intended to be sent as sticker, specially for gif, it should be always be sent as sticker as it is obviously not a screenshot |
Yes, because in the core |
maybe it was not clear enough: the problem is not the "maybe sticker" but if you are going to convert it out of sticker you need to check if it is actually a GIF type and not convert to IMAGE type always, otherwise then you apply image compression logic |
but anyways, if it is GIF type, you should preserve sticker viewtype since it is obviously not a screenshot, no need for force sticker setting in that case |
Good catch, but i'd say that if "ForceSticker" isn't set, we should rather convert it to |
the thing is that the "maybe sticker" thing is pretty bad, if client is wanting to send file as sticker it is for reasons, the screenshot scenario is an edge case, not the rule, the client is not randomly adding images as stickers... they are added as stickers because it was selected by keyboard, core should not take the sticker view type so lightly, the problem you are trying to solve here is avoiding sending screenshots as sticker, other than that, if the UI is telling you it is a sticker, it is because we want it to be a sticker 😅 |
I agree that we should probably improve heuristics and don't give up EDIT: Finally i decided to leave |
…tension (#6352) Even if UIs don't call `Message::force_sticker()`, they don't want conversions of `Sticker` to `Image` if it's obviously not an image, particularly, has non-image extension. Also UIs don't want conversions of `Sticker` to anything other than `Image`, so let's keep the `Sticker` viewtype in this case.
…tension (#6352) Even if UIs don't call `Message::force_sticker()`, they don't want conversions of `Sticker` to `Image` if it's obviously not an image, particularly, has non-image extension. Also UIs don't want conversions of `Sticker` to anything other than `Image`, so let's keep the `Sticker` viewtype in this case.
The text was updated successfully, but these errors were encountered: