Skip to content

Sync blocklist image extensions with is_binary_file#9397

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

Sync blocklist image extensions with is_binary_file#9397
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/blocklist-image-extensions

Conversation

@anshul-garg27
Copy link
Copy Markdown

Description

Follow-up to #9395 in a different file. While auditing image-extension lists across the repo I found a third copy in is_supported_blocklist_image_source (app/src/ai/blocklist/block/view_impl/common.rs) that suffers from the exact same drift: it only matches jpg | jpeg | png | gif | webp | svg, missing .bmp, .tiff / .tif, and .ico. So inline references to local .bmp / .tiff / .ico images in agent block output fail the support check and don't render as the inline image — they silently fall back to plain text — even though the same files do route to the system viewer once #9395 lands.

-                "jpg" | "jpeg" | "png" | "gif" | "webp" | "svg"
+                "jpg" | "jpeg" | "png" | "gif" | "bmp" | "tiff" | "tif" | "webp" | "ico" | "svg"

The full picture, for context:

Location What it does Pre-fix
crates/warp_util/src/file_type.rs (is_binary_file) Canonical binary-file extension list 9 image formats
app/src/util/openable_file_type.rs (is_supported_image_file) Routes click-to-open to FileTarget::SystemGeneric 6 formats — fixed in #9395
This PRapp/src/ai/blocklist/block/view_impl/common.rs (is_supported_blocklist_image_source) Gates inline rendering of agent block image references 6 formats
crates/warpui_core/src/platform/file_picker.rs (FileType::Image) Theme-creator file-picker filter 3 formats — left for a separate PR; the right "what should be selectable as a theme background" set is more subjective

Testing

Related

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Inline .bmp, .tiff / .tif, and .ico images in agent block output now render correctly instead of falling back to plain text.

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

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

@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 syncs the blocklist inline image support check with the common local image extensions handled elsewhere by adding bmp, tiff, tif, and ico, and adds targeted unit coverage for the accepted extensions, case-insensitivity, HTTP/HTTPS rejection, and non-image rejection.

Concerns

  • No blocking correctness or security 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