luanti-org / luanti-org/contentdb
Can't upload screenshot, "isn't actually an image"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 115
- Forks
- 62
- Avg merge
- 19h 7m
- Merged PRs (30d)
- 5
Description
## Summary
I'm trying to upload screenshots as jpg, by converting them from png with ffmeg. But contentdb fails to recognize them as image.
##### Steps to reproduce
* Take some png image. (For example: `default_lava.png` from devtest)
* Convert it to jpg with ffmpeg: `ffmpeg -i input_file output_file`
* Try uploading it as a screenshot on contentdb.
* It fails with the message: `Uploaded image isn't actually an image`
Here's an example, it's clearly a jpeg image, just ask `file`:

And it is, in fact, an image. Stop gaslighting me!
##### Relevant code, probably
https://github.com/minetest/contentdb/blob/master/app/logic/uploads.py
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in app/logic/uploads.py and follow the screenshot upload validation for the JPEG produced by the documented ffmpeg command. Reproduce the failure with the provided PNG-to-JPEG steps, then verify that the uploaded JPEG is accepted as an image without breaking validation for other uploads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100