Imageomics / Imageomics/cautious-robot

Get image extensions when not present in `--img-name-col` column

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

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The column used to write the filename may not have a file extension. A user might prefer to have images saved with extensions present in the filenames.

Another optional Boolean flag could be used to give the user the chance to specify something like:

  -e, --infer-extension  Infer the appropriate file extension if one is not present in the --img-name-col (default: False)

If this is switched on, some options mentioned in the discussion for #1 for doing this could be:

First, double check that there isn't a valid image extension in the --img-name-col to avoid writing a file with something like image.png.png (if there's an extension present and the user says -e, I can't imagine why they would have done so intentionally).

To detect an extension:

  • Use e.g. filetype to detect the appropriate extension based on the data itself and use that when writing the filename.
    or
  • Use the URL column to check for an extension and/or Content-Disposition header

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 at the CLI handling for --img-name-col and the code that writes downloaded images. Review the options discussed in issue #1 and its linked pull request comments, including filetype detection and URL or Content-Disposition checks. Done means an optional --infer-extension flag avoids duplicate extensions and writes an inferred extension when none is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.