Skip to content

#5666 Added in extra check if the image is already a png. #6014

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarlowBrown
Copy link
Contributor

Contributor checklist

  • My commits are rebased on the latest main branch
  • My commits are in nice logical chunks
  • My contribution is fully baked and is ready to be merged as is
  • I have tested my contribution on these devices:
  • iPhone 12, iOS 18.3.2

Description

This PR fixes #5666 by adding an additional check to ensure that incoming images with a PNG extension are handled correctly, preserving their transparent background. This resolves an issue where images shared from the iOS Photos app with a selected subject would have a white background instead of a transparent one, both in the preview and when received.

5666complete.mov

(cherry picked from commit 177c23a73379bd08a40a7e0340285495d0404dce)
@sashaweiss-signal
Copy link
Contributor

Hey @MarlowBrown. This is also a deceptively simple change, in that it treats all .png files the same way we treat stickers; specifically, it'd mean that .pngs also skip the compression we apply to the rest of images.

A more appropriate change would be to preserve the .png extension and still send the image through compression – however, even in that world I'll need to do a thorough evaluation of the downstream effects of having this method emit .pngs. It might be fine without further changes, but without doing that evaluation I'd be worried about inadvertently breaking other things.

@MarlowBrown
Copy link
Contributor Author

MarlowBrown commented Apr 8, 2025

Hey @sashaweiss-signal. Thanks for checking out this one out!

What do those downstream effects and methods that emit .pngs entail? I can understand that if someone has a large .png that it will need to be compressed; however, what is the threshold for that?

On another note, I know that you and the other developers are signal are busy, but I would appreciate it if you could check the latest emails that I sent you and let me know. They contain triage information for a good portion of the Signal iOS repository. If for some reason you didn't get the email because it contains a raw link to my specific proton drive of the triage, let me know too, and we can work something out to get you that information.

image

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