Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute system paths to images are broken. ' [WARNING] Could not fetch resource' error. #587

Open
erydit opened this issue Oct 26, 2024 · 2 comments

Comments

@erydit
Copy link

erydit commented Oct 26, 2024

quarto::quarto_version()
1.5.57

Hello!

I have multiple one-type projects and I use a single qmd file to generate DOCX reports for them.
And I use auto generated paths to insert pictures from my projects into qmd in the form like this:

:::{custom-style="Рис"}
![](/run/media/stanislav/RS_Drive/AGROProject/RESULTS/38. ОООАгрофирмаИгенче/Рисунки/Почвенная_карта_А1_1.jpg){width=16.5cm}
:::

Until some updates everything worked as expected and I could successfully generate my reports.
Now, my old code does not work and I get errors [WARNING] Could not fetch resource ./run/media/stanislav/RS_Drive/AGROProject/RESULTS/38.%20ОООАгрофирмаИгенче/Рисунки/Почвенная_карта_А1_1.jpg: replacing image with description.

As I found out in some googled messages, since quatro 1.5 the absolute system paths are not accepted, and all paths are considered relative to the location of the qmd file. But that is not true in the case of pregenerated tables - I can still add flextables, saved as rds files using absolute paths.

And that new behavior is described neither in the official documentation nor update notes (Julia stuff has only mentioned).

Did I understand correctly, that absolute paths to pictures and other resources (as well as the backward compatibility) were broken broken on purpose under the pretext of mythical repeatability? Or is this really a BUG?

Is there any way to return the ability to use absolute paths to pictures? Yes, paths to pictures transforms to 'images/pic.jpg' if I use visual editor, but not in the markdown mode, and not in the case of dynamic paths generation.

@cscheid
Copy link
Contributor

cscheid commented Oct 28, 2024

the pretext of mythical repeatability

I'd like to ask you to be more constructive when addressing the design goals of Quarto.

@erydit
Copy link
Author

erydit commented Oct 28, 2024

I'd like to ask you to be more constructive when addressing the design goals of Quarto.

Sorry, I didn't intend to appear rude.
Actually I still do not understand is this behavior is a bug or, as you said, design goal.

As a design goal, that cause several complaints:

  1. Inconsistent behavior. In visual editor added pictures are copied to images folder, but in markdown mode the user must take care of it by himself.
  2. Absolute system paths are still can be used inside code chunks.
  3. Some output formats (as pdf, docx) does not need such strict organization of resources, as in the case of web formats.
  4. Overall repeatability is the user's concern, not package's.

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

No branches or pull requests

2 participants