signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.83k stars 3.04k forks source link

Animated APNG stickers with palette are not animated #4611

Open romainricard opened 4 years ago

romainricard commented 4 years ago

Bug description

Some animated APNG stickers are not animated on Signal for iOS. While digging, I realized that the common thread between faulty stickers is that they contain a palette (i.e. PNG with a tRNS chunck).

Having a palette is very important for animated stickers, as it allows to save a lot of weight, thus allowing stickers with higher resolution/more frames to be uploaded.

Note that APNG stickers with palette do work on Signal on all other platforms.

Here are some examples:

Demo sticker with palette

This sticker is not animated on iOS. ❌ https://signal.art/addstickers/#pack_id=b020b5f29795e931cf11c4450d12ebca&pack_key=f2a19052ed4077ffbe59d7374a6a7ed7e433854abb5b5844f0af5eaf3c7f5ade

% pngcheck sticker_with_palette.png 
OK: sticker_with_palette.png (304x304, 8-bit palette+trns, non-interlaced, 24.4%).
% du -h sticker_with_palette.png 
72K sticker_with_palette.png

Demo sticker without palette (RGB)

This sticker is animated on iOS. ✔️ https://signal.art/addstickers/#pack_id=f30476e7bab76d9b73c289c97bc6fdb4&pack_key=0bb6189c1c7ab04b56a3aa59a69de5101a4a6b0dec54cc3c880732b7be7546d7

% pngcheck sticker_rgb.png
OK: sticker_rgb.png (300x300, 32-bit RGB+alpha, non-interlaced, 67.4%).
% du -h sticker_rgb.png
116K    sticker_rgb.png

Example pack containing both with and without palette stickers

This pack's only sticker that is animated on iOS is the one without a palette:

https://signal.art/addstickers/#pack_id=c8b7a540d40b85697a6f80491f78a04a&pack_key=75aa857b1bd3d7553320da129f4db97a0c10b6f4fceb9264b22d66f4292b318e

% pngcheck *.png
OK: 0.png  (270x300, 8-bit palette+trns, non-interlaced, 91.5%).
OK: 1.png  (320x300, 8-bit palette+trns, non-interlaced, 90.3%).
OK: 2.png  (334x300, 8-bit palette+trns, non-interlaced, 81.7%).
OK: 3.png  (370x300, 8-bit palette+trns, non-interlaced, -13.6%).
OK: 4.png  (270x300, 32-bit RGB+alpha, non-interlaced, 91.7%).
OK: 5.png  (270x300, 8-bit palette+trns, non-interlaced, 82.1%).
OK: 6.png  (270x300, 8-bit palette+trns, non-interlaced, 84.0%).
OK: 7.png  (300x300, 8-bit palette+trns, non-interlaced, 90.7%).
OK: 8.png  (320x300, 8-bit palette+trns, non-interlaced, -6.7%).
OK: 9.png  (270x300, 8-bit palette+trns, non-interlaced, 91.3%).
OK: 10.png (270x300, 8-bit palette+trns, non-interlaced, 89.9%).
OK: 11.png (280x300, 8-bit palette+trns, non-interlaced, 63.4%).
OK: 12.png (270x300, 8-bit palette+trns, non-interlaced, 76.4%).
OK: 13.png (280x300, 8-bit palette+trns, non-interlaced, 59.6%).
OK: 14.png (270x300, 8-bit palette+trns, non-interlaced, 71.4%).
OK: 15.png (270x300, 8-bit palette+trns, non-interlaced, 89.3%).
OK: 16.png (300x300, 8-bit palette+trns, non-interlaced, 68.3%).
OK: 17.png (270x300, 8-bit palette+trns, non-interlaced, 73.5%).
OK: 18.png (280x300, 8-bit palette+trns, non-interlaced, 59.7%).
OK: 19.png (290x300, 8-bit palette+trns, non-interlaced, 68.0%).
OK: 20.png (270x300, 8-bit palette+trns, non-interlaced, 42.6%).
OK: 21.png (300x300, 8-bit palette+trns, non-interlaced, 69.8%).
OK: 22.png (270x300, 8-bit palette+trns, non-interlaced, 50.6%).
OK: 23.png (270x300, 8-bit palette+trns, non-interlaced, 86.7%).

No errors were detected in 24 of the 24 files tested.

Steps to reproduce

Actual result: animated stickers are not animated

Expected result: animated stickers are animated

Device info

Device: iPhone 11 Pro

iOS version: 14.1

Signal version: 3.21.0.1

Note that I don't own an iOS device, so I can't provide debug log or further information.

Imperiopolis-Signal commented 4 years ago

Thanks for the detailed report, we will look into this.

5amfung commented 3 years ago

The animation doesn't work if I try to add the animated PNG that is saved in the Photo Library. All I get is just a static picture. The transparent background of the picture is just white.

The PNG I tried has no palette.

pngcheck 01.png                                                                         ✔
OK: 01.png (370x300, 32-bit RGB+alpha, non-interlaced, 60.4%).
stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

mlyeung001 commented 2 years ago

still not working

Tursko commented 1 year ago

This is an example pack that doesn't work.

https://signalstickers.com/pack/8dd301e0ed9f45dfc232774ae845780e

PICKLERICK2005 commented 9 months ago

The issue is still not resolved, is it a problem with IOS itself?