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

fix skull png #100

Merged
merged 3 commits into from
Jul 17, 2024
Merged

fix skull png #100

merged 3 commits into from
Jul 17, 2024

Conversation

advaith1
Copy link
Contributor

Hi, I'm Advaith from Discord. I got a report from a user that the skull emoji appears differently on Android vs desktop, particularly the eyes are different shapes. It seems to be because the PNG image is different from the SVG image. On desktop we use the SVGs but on Android we use the PNGs.

PNG SVG
image image

I used rsvg-convert to convert the skull's SVG to PNG so they are consistent now. However, this seems to have increased the file size significantly - is there a preferred way of optimizing the PNG?

@jdecked
Copy link
Owner

jdecked commented Jul 17, 2024

Hi @advaith1, thanks for reporting this! Usually we run the PNGs through ImageOptim at the highest compression, then confirm the compressed & original PNGs visually match. Happy to merge this once you've done that, and I assume you'll need a patch version to be published on NPM too?

@advaith1
Copy link
Contributor Author

Thanks, compressed!

re npm, it looks like the png files are not published to npm? We pull them from our GitHub fork.

@jdecked
Copy link
Owner

jdecked commented Jul 17, 2024

re npm, it looks like the png files are not published to npm? We pull them from our GitHub fork.

They aren't, but they're referenced in the code through a CDN that pulls from GitHub tags. If you just pull the images alone from your own fork/don't use the referencing code, it should be fine (unless you also rely on the tags somehow). I'll merge this now (from mobile). Let me know if you need anything else.

@jdecked jdecked merged commit 9b03e52 into jdecked:main Jul 17, 2024
@advaith1 advaith1 deleted the fix-skull-png branch July 17, 2024 16:05
@12Me21
Copy link

12Me21 commented Nov 23, 2024

Actually, the png was correct, it's the svg that is wrong here.
#34
Several emojis have shapes which were incorrectly replaced with circles/ellipses by an "optimization" many years ago
(the reason the png became desynchronized in the first place was because the svg was mistakenly changed, during an operation which supposed to reduce its filesize without changing the appearance, so they didn't re-render the pngs)
Generally: there isn't really any sequence of events which can lead to an incorrect png in twemoji. When there is a discrepancy, it's almost certain to be the svg which was accidentally changed, while the png remains correct because it was never re-rendered.

12Me21 added a commit to 12Me21/twemoji-fix-ellipses that referenced this pull request Dec 24, 2024
12Me21 added a commit to 12Me21/twemoji-fix-ellipses that referenced this pull request Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants