d2phap / d2phap/ImageGlass

Guess image fromat from magic number

Open
#2,403 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🎯 feature 👌🏻 ready
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:

2️⃣ How to use feature
  1. Download a *.webp file served with *.jpg extension from the web (or rename yourself to simulate this).
  2. Current behaviour:
  • try to open it with ImageGlass,
  • it fails to decode image (assumes jpeg),
  • displays error message
  1. 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

Open the contributing guide

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.