This page tests various image loading methods using both public and optimized images.
Using <OptimizedImage />
component with image from src/assets/images
:
Original Path: src/assets/images/sacred-adornment-hero.jpg
Width: 515px
Height: 543px
Using <OptimizedImage />
component with image from public/images
:
Path: /images/sacred-adornment-hero.jpg
Note: Width and height must be provided manually for public images
Using Astro's <Image />
component with image from src/assets/images
:
Original Path: src/assets/images/sacred-adornment-hero.jpg
Used src: /_astro/sacred-adornment-hero.DXwmKNGM.jpg
Using standard <img>
tag with image from public/images
:
Path: /images/sacred-adornment-hero.jpg
Using standard <img>
tag with src from imported image:
Original Path: src/assets/images/sacred-adornment-hero.jpg
Used src: /_astro/sacred-adornment-hero.DXwmKNGM.jpg
Using <OptimizedImage usePicture=true />
for responsive formats:
Original Path: src/assets/images/sacred-adornment-hero.jpg
Features: Responsive with multiple formats (webp, jpeg)
For this project, the recommended approach is to use the <OptimizedImage />
component as it handles both local and remote images appropriately.
When using images from src/assets
:
When using images from public
:
This section provides additional debug information about the environment:
Image import information:
{
"src": "/_astro/sacred-adornment-hero.DXwmKNGM.jpg",
"width": 515,
"height": 543,
"format": "jpg",
"orientation": 1
}
Astro Image Service: