Skip to content

GML-2067: Register PNG and GIF in TextExtractor supported MIME types#30

Closed
Bharath-Tigergraph wants to merge 1 commit intotigergraph:mainfrom
Bharath-Tigergraph:gml-2067-png-fix
Closed

GML-2067: Register PNG and GIF in TextExtractor supported MIME types#30
Bharath-Tigergraph wants to merge 1 commit intotigergraph:mainfrom
Bharath-Tigergraph:gml-2067-png-fix

Conversation

@Bharath-Tigergraph
Copy link
Copy Markdown

@Bharath-Tigergraph Bharath-Tigergraph commented Apr 9, 2026

User description

This change extends TextExtractor.supported_extensions in common/utils/text_extractors.py so .png (image/png) and .gif (image/gif) are recognized alongside existing JPEG handling.

Why: Ingestion and downstream processing rely on this map to treat uploads as supported image types. Without these entries, PNG (and GIF) files could be mishandled or rejected even when image extraction paths are otherwise correct.

Scope: Adds two MIME mappings only; no behavioral changes elsewhere in the module.


PR Type

Bug fix, Enhancement


Description

  • Register PNG and GIF MIME types

  • Extend supported_extensions mapping in initializer

  • Ensure PNG/GIF ingestion and extraction work

  • No behavior changes elsewhere


Diagram Walkthrough

flowchart LR
  TE["TextExtractor.__init__"]
  MAP["supported_extensions map"]
  PNG["Add .png -> image/png"]
  GIF["Add .gif -> image/gif"]

  TE -- "initializes" --> MAP
  MAP -- "now includes" --> PNG
  MAP -- "now includes" --> GIF
Loading

File Walkthrough

Relevant files
Enhancement
text_extractors.py
Add PNG and GIF MIME mappings                                                       

common/utils/text_extractors.py

  • Added .png -> image/png mapping
  • Added .gif -> image/gif mapping
  • Expands image formats recognized by extractor
+2/-0     

@tg-pr-agent
Copy link
Copy Markdown

tg-pr-agent bot commented Apr 9, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Extension Normalization

Verify that file extension handling is case-insensitive and normalized (e.g., '.PNG', '.Gif') so these map correctly to the added MIME types.

'.png': 'image/png',
'.gif': 'image/gif',
GIF Handling

Confirm downstream extraction paths gracefully handle GIFs (including animated GIFs) to avoid unexpected processing errors or performance overhead after enabling this type.

'.png': 'image/png',
'.gif': 'image/gif',

@tg-pr-agent
Copy link
Copy Markdown

tg-pr-agent bot commented Apr 9, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant