Guess image fromat from magic number
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 752
- Avg merge
- 10d 14h
- Merged PRs (30d)
- 1
Description
Windows OS version
Windows 10 22H2 OS Build 19045.6466
ImageGlass version
9.6.0.801
ImageGlass release
Classic
1️⃣ Describe the feature
I would like the program, in addition to just guessing from file extension to:
- use a list of know magic bytes (https://en.wikipedia.org/wiki/List_of_file_signatures) for supported image formats WHEN image decoding fails
2️⃣ How to use feature
- Download a
*.webpfile served with*.jpgextension from the web (or rename yourself to simulate this). - Current behaviour:
- try to open it with ImageGlass,
- it fails to decode image (assumes jpeg),
- displays error message
- Wanted behaviour:
- try to open it with ImageGlass,
- it fails to decode image (assumes jpeg),
- fallbacks to guess by reading few bytes of the file,
- looks up in known lists,
- gets a match,
- uses appropriate decoder (webp),
- displays the image.
3️⃣ Additional context
Would possibly help to fix an issue where the program is unable to open files without extension https://github.com/d2phap/ImageGlass/issues/523
Contributor guide
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
The issue does not name a file, test, or entry point. Start by locating the image-opening and decoding flow, then trace how the file extension selects a decoder and how decode failures are reported. Done means a supported image with a misleading or missing extension can be identified from its magic bytes and opened with the matching decoder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100