Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Inconsistencies in the handling of public_folder in image paths: Discrepancies between expectations and results #1123

Open
lorensansol opened this issue Aug 27, 2024 · 1 comment

Comments

@lorensansol
Copy link

  • If I use public_folder: /foo
    • Expectation?: image: /foo/example.jpg
    • Reality: image: /foo/example.jpg βœ…
  • If I use public_folder: /foo/
    • Expectation?: image: /foo/example.jpg
    • Reality: image: /foo//example.jpg πŸ†— It is ok because there is the previous option
  • If I use public_folder: ''.
    • Expectation?: image: example.jpg ⬅️ I would especially like this
    • Reality: image: /example.jpg ❌
  • If I use public_folder: /
    • Expectation?: image: /example.jpg
    • Reality: image: //example.jpg ❌
@lorensansol
Copy link
Author

I also have problems with images in subdirectories

With media_folder: assets/media, I have this:

Captura de pantalla 2024-08-27 a las 13 59 41 Captura de pantalla 2024-08-27 a las 13 49 21
  • If I use public_folder: '' and public_folder: /:
    • fondo.jpg βœ…
    • /fondo.jpg βœ…
    • base/logo.png ❌ 😱 No expected ⬅️ I would especially like this
    • /base/logo.png ❌ 😱 No expected
    • foo/fondo.jpg ❌ πŸ†— Expected
    • /foo/fondo.jpg ❌ πŸ†— Expected
    • foo/base/logo.png ❌ πŸ†— Expected
    • /foo/base/logo.png ❌ πŸ†— Expected
Captura de pantalla 2024-08-27 a las 14 02 26
  • If I use public_folder: /foo and public_folder: /foo/:
    • fondo.jpg βœ… 🀷
    • /fondo.jpg βœ… 🀷
    • base/logo.png ❌ 🀷
    • /base/logo.png ❌ 🀷
    • foo/fondo.jpg βœ…
    • /foo/fondo.jpg βœ…
    • foo/base/logo.png βœ…
    • /foo/base/logo.png βœ…
Captura de pantalla 2024-08-27 a las 14 00 33

Working locally, when an image does not load, I get this error in the console:

error: Error handling {"branch":"main","action":"getMediaFile","params":{"branch":"main","path":"assets/mediabase/logo.png"}}: ENOENT: no such file or directory, open '/[PROJECT-PATH]/assets/mediabase/logo.png'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant