ScreenshotAssistant icon indicating copy to clipboard operation
ScreenshotAssistant copied to clipboard

Images always come out as JPEGs internally

Open henrik-leppa opened this issue 3 years ago • 1 comments

Thank you for creating this wonderful app.
:+1:
There is one problem I’ve found:

  1. I take a screenshot.
  2. I choose PNG as the format.
  3. I share it with my computer using Bluetooth.
  4. I open it with an image viewer.
  5. The image viewer says that the file is not a valid PNG.
  6. I open the image with a hex editor.
  7. The first letters in the file are: JFIF (indicating the file is actually a JPEG), when the first letters should be: PNG.

I did the same thing but chose WEBP as the format, but the file still started with: JFIF, instead of something like: RIFFr WEBPVP8.

I also redid both of the aforementioned actions, but shared the file using Phone Saver (version 5.2.1), but the same thing happened.

It seems that the file always comes out as a JPEG on the inside, and only the file extension (.jpeg, .png, .webp) changes.

(Note: Most programs (like the web browsers) are coded the silently ignore a disparity between file extension and contents, which might have masked this issue.)

I am using F-Droid Screenshot Assistant (version 2.0.1), with Android 9.

If you need more diagnostics information, just ask.
:slightly_smiling_face:

henrik-leppa avatar Aug 05 '20 12:08 henrik-leppa

What an insanely good catch! Already found the problematic code section. I am currently wrinting my master's thesis though, so its really hard to find the time.

It may take me some time to squeeze this in. I am however always open to good pull requests :P

beatbrot avatar Aug 07 '20 16:08 beatbrot