Relative paths and option to copy pictures and linked files into data directory

Bug #855443 reported by Paddy
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
RedNotebook
In Progress
Wishlist
Jendrik Seipp

Bug Description

Currently it is not possible to "migrate" a journal to a different location on your harddrive without loosing the correct link information to pictures and files. If you insert a picture and/or file, an absolute path is inserted into the journal source text.

Would it not be possible to:
* support relative links
* provide a choice between relative and absolute paths.

Regards,

Patrick.

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: [Bug 855443] [NEW] Absolute vs relative paths in links

Thanks for the report. It is planned to copy all linked files into a
RedNotebook subdirectory and save the links relatively.

Revision history for this message
Paddy (patrick-kudos) wrote : Re: Absolute vs relative paths in links

Hi Jendrik,

Great to hear :-)

Regards,

Patrick.

Changed in rednotebook:
importance: Undecided → Wishlist
summary: - Absolute vs relative paths in links
+ Add option to copy pictures and linked files into data directory
Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: Add option to copy pictures and linked files into data directory

Recently a new feature has been added that allows adding links relative to the journal directory:

[My notes from december ""2012-12.txt""]

[A file in the journal directory ""myfile.pdf""]

Changed in rednotebook:
status: New → In Progress
assignee: nobody → Jendrik Seipp (jendrikseipp)
Revision history for this message
Paddy (patrick-kudos) wrote :

Using RN 1.6.5: the relative link option does not work for inserted images, only files. It makes sense to support it for both types.

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: [Bug 855443] Re: Add option to copy pictures and linked files into data directory

Could you please post an example link that doesn't work

Revision history for this message
Paddy (patrick-kudos) wrote : Re: Add option to copy pictures and linked files into data directory

Here are some examples. The first one works (it displays the picture inlines, the other ones do not:

[""file:///C:\Users\patrivdv\Documents\Journals\Dummy\sample-4"".jpg]

[""sample-4"".jpg]

[""sample-4.jpg""]

[test ""sample-4"".jpg]

[test ""sample-4.jpg""]

in Preview mode it looks like:

<picture>

[sample-4.jpg]

test

test

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Thanks, I forgot to handle images...

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

This is now fixed in the development code.

Revision history for this message
Alexander (jamato-krym) wrote :

I am using version 1.6.6
Under Windows XP still not work relative link to file, for example:

[test.txt ""file:///full_path_to_diary_folder/files/test.txt""] work in Ubuntu
[test.txt ""file:///full_path_to_diary_folder\files\test.txt""] work in Windows

[test.txt ""files/test.txt""] work in Ubuntu
[test.txt ""files\test.txt""] not work in Windows

but relative link to image work in Windows:
[""files\my_picture"".png]

Revision history for this message
Paddy (patrick-kudos) wrote :

I can confirm this behaviour Windows 7 also: relative paths to images work now, but it is broken to ordinary files. Can this be fixed because it used to work!

Changed in rednotebook:
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Relative links should now work on windows (at least in unreleased dev version).

Revision history for this message
Michael Entrup (entrup) wrote :

Test with RedNotebookPortable 1.7.1 on WinXP.
Relative links work fine now. I tested the following cases:

1. Files in the notebook directory
2. Files in subfolders of the notebook directory
3. Accessing files with ..\<folder>\<file>
4. Images at the notebook directory
5. Images in subfolders of the notebook directory
6. Accessing images with ..\<folder>\<image>

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: [Bug 855443] Re: Add option to copy pictures and linked files into data directory

Thanks for your tests! The next step will be to allow users to copy the
files relatively when inserting them.

Revision history for this message
Naim Zard (naimzard) wrote : Re: Add option to copy pictures and linked files into data directory

Hi Jendrik,
The relative path is enough. No need to have Rednotebook copy all the files to a subdirectory.

If someone cares about keeping the relative path, then they can easily create a folder and put in it their media files.
They even can separate them in different folders and sub-folders as they wish, ex: Audio, Text, Images etc.

What do you think?

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: [Bug 855443] Re: Add option to copy pictures and linked files into data directory

That's true, however an option (not the default) should be added.
Otherwise nobody will notice the new feature.

Revision history for this message
Daniel Seifert (dseifert) wrote : Re: Add option to copy pictures and linked files into data directory

Though relative links are supported, they are not added automatically. I.e. I copy all files I want to be part of my journal into the journal directory, but when I insert any of them they are added as relative.

Wouldn't it be a sensible idea to have RNB detect that a file is within the journal directory (data_dir) and convert to a relative link automatically?

summary: - Add option to copy pictures and linked files into data directory
+ Relative paths and option to copy pictures and linked files into data
+ directory
Revision history for this message
Neudrino (neudrino) wrote :

Hi there, and sorry if I dig out this old feature request.
But I have to disagree with Naim Zard!

Having Rednotebook copy all drop down files to data directory is an essential feature in my eyes!

I think, it has been agreed on, that having relative links is good, in order to make RB "portable" between different (file) systems. But as long as there is no easy way to sync all media data included with the journal, this is essentially useless and not user friendly.

Longer explanation:
The data directory is usually hidden (and might be integrated in AppData on Windows), so normal end users will never browse there manually. They want to put in files into the journal easily. And they should show up in the journal, so that they can view/access them with 1Click (or integrated for images). This should also work across synchronized systems, thus synchronising added media data is important. The expected complaint of the average user would be: "I added this picture to my journal at my home-PC and synced it with my notebook. Why is the picture not showing up on my laptop?" And than try to explain what symbolic links are, and how they work...
Moreover the expected behaviour form most users would be, that the program is self-consistent / -sufficient / -contained. Again the average user example: Downloading a picture to Downloads folder. Than dragging it to the program. After that, cleaning up the Downloads folder and thereby deleting the picture. And than asking the question: "Why is the picture I added to my journal not showing up any more? I added it to the program!"
I hope these two examples illustrate the problems I have, not copying media files to the journal directory!

As the journal is grouped by month, I would suggest to do the same for the media data. For every yyyy-mm.txt there should be a yyyy-mm folder where media goes to (if files are present). This way it would be easy to share/sync/archive/work on parts of the total journal.

Of course there should be options in the config-menu, where I can select the default behaviour. Optional a question box on drag&drop would be good (like "always ask what to do").
What is the best default behaviour, is clearly a matter of debate and opinion!
To me it always seems, that the average user sees a program as a closed thing, which is not referring to content outside of it ("I added it to the program!"). So in my eyes the "copy in data folder and set a relative link" should be default, to give the expected behaviour to the normal user.

It is my hope, that I could convince you, that saving drag&drop files to the data directory and adding symbolic links, would be an essential addition to RB! As you proposed this feature in reply 1, it is my feeling, that you are aware that this addition would make your program interesting for a wider audience.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.