Skip to content

Skip local variant detection for remote URL images#865

Open
William-Laverty wants to merge 1 commit intotwostraws:mainfrom
William-Laverty:fix/image-remote-url-handling
Open

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

Conversation

@William-Laverty
Copy link

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.

Fixes #864.

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.
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.

Support full, remote URL for Images.

1 participant