luanti-org / luanti-org/contentdb

Can't upload screenshot, "isn't actually an image"

Open
#558 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@ Server Bug
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`:
![default_lava](https://github.com/user-attachments/assets/443862b9-b365-4bc0-b20e-a028f6fada99)

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.