Skip to content

added png extension#31

Open
Bharath-Tigergraph wants to merge 1 commit intomainfrom
GML-2067-png-fix
Open

added png extension#31
Bharath-Tigergraph wants to merge 1 commit intomainfrom
GML-2067-png-fix

Conversation

@Bharath-Tigergraph
Copy link
Copy Markdown

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

User description

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

  • Add PNG and GIF MIME mappings

  • Expand supported image types in extractor

  • Prevent rejection of PNG and GIF uploads

  • No changes to processing logic


Diagram Walkthrough

flowchart LR
  A["TextExtractor.__init__"] -- "extend `supported_extensions`" --> B["Add .png and .gif MIME types"]
  B -- "enables" --> C["PNG/GIF upload recognition"]
Loading

File Walkthrough

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

common/utils/text_extractors.py

  • Map '.png' to 'image/png'
  • Map '.gif' to 'image/gif'
  • Extend supported_extensions dictionary
+2/-0     

@tg-pr-agent
Copy link
Copy Markdown

tg-pr-agent bot commented Apr 10, 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

Edge Case

Verify that file extension lookups are case-insensitive (e.g., '.PNG', '.Gif'). If normalization to lowercase is not guaranteed elsewhere, consider lowercasing inputs or adding a normalization step to avoid missed matches.

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

@tg-pr-agent
Copy link
Copy Markdown

tg-pr-agent bot commented Apr 10, 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