beatbrot / beatbrot/ScreenshotAssistant

Images always come out as JPEGs internally

Open
#75 1 comment 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Kotlin
Stars
60
Forks
12
PR merge metrics
No merged PRs in 30d

Description

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)](https://f-droid.org/en/packages/link.standen.michael.phonesaver/), 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)](https://f-droid.org/packages/de.beatbrot.screenshotassistant/), with Android 9.

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in ScreenshotAssistant 2.0.1 on Android 9, selecting PNG and WEBP and checking the file signatures after sharing. Trace the screenshot encoding and sharing flow to find where the selected format is lost; done means the exported files have valid contents for their extensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.