signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.65k stars 2.67k forks source link

`.png` extension for "standard" quality images which were re-encoded to JPEG #6882

Open scy opened 5 months ago

scy commented 5 months ago

Using a supported version?

Overall summary

When sending a PNG image with "standard" (not "high") image quality, Signal will re-encode it to a JPEG instead. However, when hitting the "download" button on the image, the suggested file extension will be .png instead.

Steps to reproduce

  1. Send a PNG image with "standard" image quality.
  2. Click on that image in the chat.
  3. Click the "download" button (arrow pointing into a tray).
  4. A file picker dialog will open.

Expected result

The suggested file name should end in .jpeg or .jpg to accurately represent the file format. This is especially important for operating systems that decide based on the file name which application to use when opening the file.

Actual result

The file picker dialog is suggesting a name like signal-2024-05-20-140823_002.png, even though the file has been re-encoded into a JPEG.

Saving it and the running the Linux file tool confirms that it's indeed a JPEG:

$ file signal-2024-05-20-140823_002.png 
signal-2024-05-20-140823_002.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 928x640, components 3

Screenshots

image

Signal version

7.5.1

Operating system

Debian 12 (bookworm) amd64

Version of Signal on your phone

7.7.1

Link to debug log

No response

jamiebuilds-signal commented 5 months ago

Could you try downloading the image using the inline download button next to the message and see if what result you get?

Screenshot 2024-05-24 at 2 18 41 PM

Could you also try it with pngs of different sizes?

You can use this tool I created to test out images of different sizes:

scy commented 5 months ago

@jamiebuilds-signal I can do that, if you think that the inline button makes any difference.

Do you think that using the "Note to Self" chat will work for that, or do I need to bother one of my contacts with this?

scottnonnenberg-signal commented 5 months ago

@scy Yes, Note to Self will be useful to check. The version of the file that we save locally (and sync to your other devices) is the version that we would send to your recipients.