View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011279 | Scribus | Graphics / Image Frames | public | 2012-12-19 21:37 | 2014-07-24 21:10 |
Reporter | Frederic.Bron | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | feedback | Resolution | open | ||
Platform | x86_64 | OS | Fedora Core | OS Version | 17 |
Product Version | 1.4.1 | ||||
Summary | 0011279: Image links get corrupted when symlinks involved | ||||
Description | Sometimes but quiet often, when reopening a file, the image links get lost and a red cross replaces images. This happen to be an issue with the PFILE field in the .sla file. I can edit the file in vim and replace all PFILE fields and the file is OK to be opened again. Example: good PFILE="img/image.eps" bad PFILE="../../../../../../../a/b/c/d/e/img/image.eps" This is exactly the same as http://bugs.scribus.net/view.php?id=5249 which was closed 5 years ago because it was marked as duplicates. However, I do not see the link with the duplicates. | ||||
Steps To Reproduce | The problem is reproducible: in you home directory /home/userid, untar the attached pfile_bug.tar.bz2 in your home directory, create a directory foo with inside a symbolic link to your home directory: $ cd $ tar xvfj pfile_bug.tar.bz2 $ mkdir foo; cd foo; ln -s ../ home Then open nautilus, go to your home directory then down to foo, down to home, down to pfile_bug and from here, open pfile_bug.sla by double clicking. Then Scribus thinks it starts in /home/userid/foo/home/pfile_bug which is in fact /home/userid/pfile_bug. If you now save the file, the PFILE link gets wrong. It was "img/image.eps" and is now "../../../pfile_bug/img/image.eps". Note that "../pfile_bug/img/image.eps" would work but is not good either because if we rename the pfile_bug directory it is wrong again. | ||||
Additional Information | Work around: if you have links like that, open scribus from a terminal in the right directory or follow direct directory chain. | ||||
Tags | No tags attached. | ||||
Patch | |||||
2012-12-19 21:37
|
|
|
I am the reporter of this bug. I had to delete my first account because I realized it was not a good idea to have my email adress as username (visible publicly!). If you can change that, would be fine. |
|
I reassigned the bug to you. Thanks for the detailed explanation, i was previously unable to reproduce this issue. |
|
Probably, the paths to image and .sla files are converted differently. .sla file keeps the symlinks in the path and images remove them and have a direct path. Then Scribus goes up in the directory structure of the .sla file up to the common prefix. This is why there are too much ../. Example: directory of .sla file: /home/userid/pfile_bug or /home/userid/foo/home/pfile_bug files: /home/userid/pfile_bug/plfile_bug.sla, /home/userid/pfile_bug/img/image.eps converted to: /home/userid/foo/home/pfile_bug/pfile_bug.sla /home/userid/pfile_bug/img/image.eps common prefix: /home/userid which is ../../../ relative to .sla directory -> PFILE="../../../pfile_bug/img/image.eps" |
|
I committed a partial fix for this issue. The .sla real path is now used as the base directory for relative paths when saving documents. Note that path such as "../pfile_bug/img/image.eps" may still be used when image path contains a symlink. Using systematically the real path for image is not appropriate as it may break cases where images are stored in a subdirectory of the sla directory and that subdirectory is itself a symlink. |
|
What's the fate of this issue? Do we need to close this one and clone a new issue to describe the rest of the fix needed? |
|
Checking some of my SLA files, I have found various files where some PILES was "../../../../../somelinksfolder/symlinktosomeSLAfolder/images" instead of plain "images". As a consequence, i had to edit the SLA and correct the PFILE to change it into plain 'images'. However this change is tedious, I'm not sure there is a possible improvement apart with 0011776 or 0011558 proposed "image manager" improvements. @jghali : Note that both the image file and the SLA file could have been, at some time in their edit history, accessed via a symlink. |
|
/me is wondering why scribus does care about symlinks... |
|
Kunda, no we should not close this one. ale, well unfortunately on *nix we have to if we want to generate relative paths correctly. The fact we were not handling symlinks at all is the trigger of this issue. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-12-19 21:37 |
|
New Issue | |
2012-12-19 21:37 |
|
File Added: pfile_bug.tar.bz2 | |
2012-12-19 21:45 | Frederic.Bron | Note Added: 0029459 | |
2012-12-19 21:55 | jghali | Reporter | user4408 => Frederic.Bron |
2012-12-19 22:00 | jghali | Relationship added | has duplicate 0011049 |
2012-12-19 22:03 | jghali | Note Added: 0029461 | |
2012-12-19 22:03 | jghali | Summary | Image links get corrupted => Image links get corrupted when symlinks involved |
2012-12-19 22:05 | jghali | Note Edited: 0029461 | |
2012-12-20 11:34 | Frederic.Bron | Note Added: 0029465 | |
2013-01-06 15:50 | jghali | Note Added: 0029614 | |
2014-07-24 00:50 | Kunda | Note Added: 0032943 | |
2014-07-24 00:50 | Kunda | Assigned To | => jghali |
2014-07-24 00:50 | Kunda | Status | new => feedback |
2014-07-24 16:31 | JLuc | Note Added: 0032963 | |
2014-07-24 16:31 | JLuc | Note Edited: 0032963 | |
2014-07-24 19:31 | ale | Note Added: 0032965 | |
2014-07-24 19:50 | jghali | Assigned To | jghali => |
2014-07-24 21:10 | jghali | Note Added: 0032968 | |
2015-09-17 20:10 | Kunda | Category | Graphics / Image Frames => Graphics/Img Frames |
2015-09-17 20:11 | Kunda | Category | Graphics/Img Frames => Graphics / Image Frames |