grav icon indicating copy to clipboard operation
grav copied to clipboard

Subdirectory issue using image:// PHP stream

Open pjohanneson opened this issue 3 years ago • 0 comments

I've run into an issue trying to use the image:// PHP stream along with subdirectories.

Here's the layout of my user/images directory:

user/images
  - aurora.jpg
  -  2022/
     - 12/
        - flowers.jpg

If I use the image in the top level of the user/images directory, everything works:

[![Aurora](image://aurora.jpg)](image://aurora.jpg)

... as expected, the image appears in the page and I can click through to load the image.

However, the subdirectories don't work as I'd expect:

[![Flowers](image://2022/12/flowers.jpg)](image://2022/12/flowers.jpg)

...shows the word "Flowers", which is linked to the image. If I right-click on the "Flowers" text and try to view the image in a new tab, the URL I'm taken to is http://image:2022//12/flowers.jpg.

However, I can make the image appear in the HTML page by removing a / from the image: stream URL:

[![Flowers](image:/2022/12/flowers.jpg)](image://2022/12/flowers.jpg)

... shows the image in the page and also allows me to click through to the image's URL. But removing that / from the linked URL at the end breaks it again:

[![Flowers](image:/2022/12/flowers.jpg)](image:/2022/12/flowers.jpg)

...displays the image in the page, but clicking through takes me to an invalid URL (image:/2022/12/flowers.jpg).

pjohanneson avatar Dec 04 '22 04:12 pjohanneson