mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
Currently, @astrojs/image allows *importing* images from srcDir only. Importing images from outside srcDir fails miserably *in dev mode* and produces incorrect src. This happens because `path.relative(fileURLToPath(config.srcDir), id)` resolves to "../something" and when joined with '/@astroimage' cancels it out (`join('/@astroimage', '../../something')` => `'/something'`). Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always export absolute path to the target file.
1.4 MiB
2024x1012px
1.4 MiB
2024x1012px
![](/Infrastructure/astro/raw/commit/ebb40f5cb093e9be5f856a98bf5ffd65a814218b/packages/integrations/image/test/fixtures/basic-picture/social.png)