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

Image path assumed to be relative to Output directory #36

Open
Kdebaas opened this issue Dec 11, 2015 · 7 comments
Open

Image path assumed to be relative to Output directory #36

Kdebaas opened this issue Dec 11, 2015 · 7 comments

Comments

@Kdebaas
Copy link

Kdebaas commented Dec 11, 2015

Hi, love your program.

I had some trouble replacing images. Inspecting the generated Scribus files for missing images, it appeared the document was expecting them on a path relative to the Output directory.

Cheers

Klaas

@berteh
Copy link
Owner

berteh commented Dec 13, 2015

Thanks @Kdebaas for the kind feedback.

The images path is actually relative to the template (source sla) location. Thus, if you save your output document(s) in the same directory they will be found naturally.

As I prefer to keep things neat I try to avoid to generate my (output) document(s) in the 'source' directory and thus use a typical setup like below, that has the benefit of clearly distinguishing source and generated material, while ensuring working references (since images paths would be ../imgs/<image> for both source template and generated material.

/project/template/<source.sla>
/project/imgs/<symbolic links to all external resources>
/project/output/<output sla and pdf>

Do you have a suggestion on how to make this work better? Or should I simply make this more explicit in the documentation?

have a nice day,
Berteh.

@Kdebaas
Copy link
Author

Kdebaas commented Dec 14, 2015

My setup was as follows:

    /project/<source.sla>
    /project/images/<images>
    /project/output/<output.sla and pdf>

A nice feature would be that ScribusGenerator updates the paths in the output.sla relative to its own location.

Until then, it would be wise to mention something in the documentation.

Absolute paths might also solve this problem, but this is still a feature of Scribus under discussion.

All the best.

Klaas

@berteh berteh added this to the not planned milestone Dec 15, 2015
@berteh
Copy link
Owner

berteh commented Dec 15, 2015

Thanks Klaas.

I take note of the suggestion to update images paths to account for the (input-output) directory difference, but as it does not seem that straightforward (esp. in Windows) I don't see it happening any time soon.

Easier way would be to add an option to replace all images refs by absolute paths indeed, will try to see how that fares with different drive letters in Windows, as that may be an issue.

B.

@berteh berteh modified the milestones: 3.0, not planned May 23, 2016
@Wuestenschiff
Copy link

This just costed me an hour of my live this is really not intuitive... maybe add a root folder otopn or data folder option

@berteh
Copy link
Owner

berteh commented Mar 25, 2019

Hello @Wuestenschiff.

Sorry to read this was difficult for you. If you have the time to try to change the script to add this option I'd gladly review and add your changes.

KIndly note this topic is not that straightfoward. Related discussions happen here for Scribus: https://bugs.scribus.net/view.php?id=6518

Meanwhile you may be interested in either using symbolic links (I simply add a symbolic link in the output directory to the images directory of the input, its flexible, quick and allows for more than one "root" folder in case you use more), or in using the "utility" script that changes location of all images in source (template) file: https://github.com/berteh/ScribusGenerator/blob/master/utils/ResetVARImagesPaths.py

Hope this helps.

@chevdor
Copy link

chevdor commented Jun 4, 2024

If you use "Collect for output" in Scribus, you will get:

file.sla
+ images
   image1.png
   ...

I was also cought offguard running into issues despite of the image being available in a standard location.

Since it is scribus "standard" it would be nice to comply with that by default, and maybe add an option to overrtide this default for those whos workflow differ.

@chevdor
Copy link

chevdor commented Jun 4, 2024

So the workaround atm is a bit heavy but the following works:

  • your images MUST be at the same level than the SLA
  • your images MUST be duplicated into the output dir

Duplication is never a good idea so it would be great if the images could be taken from where they are defined in the SLA.

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

No branches or pull requests

4 participants