Skip to content

Recognize .bmp, .tiff, .tif, and .ico as supported image files#9395

Open
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/sync-image-file-extensions
Open

Recognize .bmp, .tiff, .tif, and .ico as supported image files#9395
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/sync-image-file-extensions

Conversation

@anshul-garg27
Copy link
Copy Markdown
Contributor

Description

is_supported_image_file in app/src/util/openable_file_type.rs and is_binary_file in crates/warp_util/src/file_type.rs carry overlapping image-extension lists, but they're not in sync:

Extension is_binary_file is_supported_image_file
jpg / jpeg / png / gif / webp
svg ❌ (text-based)
bmp
tiff / tif
ico

The four bottom rows are the bug. Their flow today:

  1. is_file_openable_in_warp(file.bmp) → returns None because is_binary_file matches.
  2. Callers (e.g. ai/blocklist/block.rs:274, notebooks/link.rs:355, ai/ai_document_view.rs:919) then check is_supported_image_file to decide whether to route to FileTarget::SystemGeneric (i.e. open in Preview / system default).
  3. That returns false, so the file falls through with no working target — clicking a .bmp / .tiff / .ico link from a notebook or AI block has no effect.

This change adds the four missing extensions to is_supported_image_file so they route to the system viewer the way .png and friends already do. svg stays in is_supported_image_file only — it's text/XML and correctly excluded from is_binary_file.

Testing

Changelog Entries for Stable

CHANGELOG-BUG-FIX: .bmp, .tiff/.tif, and .ico files now open in the system default viewer when clicked from notebooks and AI blocks, matching the behavior already in place for .png, .jpg, etc.

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@anshul-garg27

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds bmp, tiff, tif, and ico to the supported image extension check so binary image links can route to the system viewer, and adds regression coverage for the full supported image list plus case-insensitive extensions.

Concerns

  • No blocking correctness, security, or maintainability concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant