Skip to content

Skip local variant detection for remote URL images#865

Merged
MrSkwiggs merged 1 commit intotwostraws:mainfrom
William-Laverty:fix/image-remote-url-handling
Mar 2, 2026
Merged

Skip local variant detection for remote URL images#865
MrSkwiggs merged 1 commit intotwostraws:mainfrom
William-Laverty:fix/image-remote-url-handling

Conversation

@William-Laverty
Copy link
Contributor

@William-Laverty William-Laverty commented Feb 25, 2026

Summary

When an Image is initialized with a remote URL (http/https), skip the local filesystem variant detection (findVariants) that searches for @2x and ~dark alternatives in the assets directory.

Problem

As noted in #864, remote URLs already work with Image, but Ignite attempts to find local file variants for them — scanning the assets directory for density and appearance alternatives. This is unnecessary for remote images and produces warnings when the assets directory doesn't contain matching files.

Fix

  • Add an isRemote flag to render(path:description:) that skips findVariants() entirely for http/https URLs.
  • Detect remote URLs in markup() by checking the URL scheme.

This is a minimal, targeted change — remote images emit a clean <img> tag without triggering filesystem operations.

When an Image is initialized with a remote URL (http/https), skip the
local filesystem variant detection (findVariants) that looks for @2x
and ~dark alternatives in the assets directory. This avoids spurious
'Could not read the assets directory' warnings when using remote images.

Fixes twostraws#864.
@MrSkwiggs MrSkwiggs self-assigned this Mar 2, 2026
@MrSkwiggs
Copy link
Collaborator

Thanks for your contribution @William-Laverty!
I've elected to disable automatic resolution of #864 for now, as that issue was happening for an older release of Ignite.

Your changes look good to me however, so I'm happy to merge this.
We'll close #864 manually once OP gets a chance to report back.

@MrSkwiggs MrSkwiggs merged commit 4836398 into twostraws:main Mar 2, 2026
1 check passed
@William-Laverty William-Laverty deleted the fix/image-remote-url-handling branch March 13, 2026 05:12
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.

2 participants