Media manager - 'Replace substring' doesn't work

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Media manager - 'Replace substring' doesn't work

Doug-11
Noobie using 3.0.1.
I've imported a gramps gpkg from version 2.x into 3.0.1 and want to
organise my media better, putting them all into a subfolder. Instead of
having the base media attached to the topdirectory of user, I want to
put it in the subfolder with the other media.

At present the paths to the media are long full paths like

/home/doug/Doc/Gen/FTree/26_05_08.gpgmedia/home/doug/Doc/Gen/FTree/18_05_08.gpgmedia/home/doug/Doc/Gen/FTree/12_05_08.gpgmedia


which I want to shorten to

26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia......

intending to mean that they reside in the current (subfolder) directory.

However, I don't seem to be able to get any batch behaviour from Media
Manager:

when I use  'Replace substring' ,   replace  /home/doug/Doc/Gen/FTree/
with nothing,  either
(1) no media path is altered
OR
(2) only the first media path is altered, but *not* first substring.
That remains, i.e.

/home/doug/Doc/Gen/FTree/26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia.


Running Media Manager again doesn't change it.

Am I misunderstanding, doing something wrong, or is there a bug?

I'd be grateful for any help.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Media manager - 'Replace substring' doesn't work

Benny Malengier


2008/6/5 Doug <[hidden email]>:
Noobie using 3.0.1.
I've imported a gramps gpkg from version 2.x into 3.0.1 and want to
organise my media better, putting them all into a subfolder. Instead of
having the base media attached to the topdirectory of user, I want to
put it in the subfolder with the other media.

At present the paths to the media are long full paths like

/home/doug/Doc/Gen/FTree/26_05_08.gpgmedia/home/doug/Doc/Gen/FTree/18_05_08.gpgmedia/home/doug/Doc/Gen/FTree/12_05_08.gpgmedia

I have the impression you extract gpkg media always to the same place, like this the path keeps growing.
I personally don't like this much.

In 3.0.x, you have media directory in the preferences you can set. Then all your media can be changed to 'relative media paths' meaning the path will be given relative as to the media directory given in the preferences (part of the options in the edit menu).
Relative media is in my opinion what you should use when working with gpkg files, as it is the only way to keep things not nesting on import as in the example you give.


which I want to shorten to

26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia......

intending to mean that they reside in the current (subfolder) directory.

This looks like a bad directory name to me, but obviously, you are free to make this choice.

However, I don't seem to be able to get any batch behaviour from Media
Manager:

when I use  'Replace substring' ,   replace  /home/doug/Doc/Gen/FTree/
with nothing,  either
(1) no media path is altered
OR
(2) only the first media path is altered, but *not* first substring.
That remains, i.e.

/home/doug/Doc/Gen/FTree/26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia.

The reason is that the media are given as absolute, so the absolute path is shown. As you replace '/home/....' the first part of a path cannot be replaced, as the path   /home/doug/Doc/Gen/, actually means:
root / + path home/doug/Doc/Gen/
In Windows, this would be eg:
root C:\ + path home/doug/Doc/Gen/

The root part is not part of the string you are replacing.

Running Media Manager again doesn't change it.

Am I misunderstanding, doing something wrong, or is there a bug?

In your case, experiment with the absolute path (you are using that now)  and the relative path. The media manager can change between those. For string substitution, be carefull, and note that the root part is not part of the string you can replace (that is how I remember it, however, I can be wrong, didn't check the code, but I would be amazed if you could change absolute path (root present) to relative path (root not given) with a string substitution).

Let us know if you succeed.

Benny


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Media manager - 'Replace substring' doesn't work

Doug-11
Benny Malengier wrote:

>
>
> 2008/6/5 Doug <[hidden email]
> <mailto:[hidden email]>>:
>
>     Noobie using 3.0.1. <http://3.0.1.>
>     I've imported a gramps gpkg from version 2.x into 3.0.1 and want to
>     organise my media better, putting them all into a subfolder.
>     Instead of
>     having the base media attached to the topdirectory of user, I want to
>     put it in the subfolder with the other media.
>
>     At present the paths to the media are long full paths like
>
>     /home/doug/Doc/Gen/FTree/26_05_08.gpgmedia/home/doug/Doc/Gen/FTree/18_05_08.gpgmedia/home/doug/Doc/Gen/FTree/12_05_08.gpgmedia
>
>
> I have the impression you extract gpkg media always to the same place,
> like this the path keeps growing.
> I personally don't like this much.
>
> In 3.0.x, you have media directory in the preferences you can set.
> Then all your media can be changed to 'relative media paths' meaning
> the path will be given relative as to the media directory given in the
> preferences (part of the options in the edit menu).
> Relative media is in my opinion what you should use when working with
> gpkg files, as it is the only way to keep things not nesting on import
> as in the example you give.
>
>
>     which I want to shorten to
>
>     26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia......
>
>     intending to mean that they reside in the current (subfolder)
>     directory.
>
>
> This looks like a bad directory name to me, but obviously, you are
> free to make this choice.
>
>
>     However, I don't seem to be able to get any batch behaviour from Media
>     Manager:
>
>     when I use  'Replace substring' ,   replace  /home/doug/Doc/Gen/FTree/
>     with nothing,  either
>     (1) no media path is altered
>     OR
>     (2) only the first media path is altered, but *not* first substring.
>     That remains, i.e.
>
>     /home/doug/Doc/Gen/FTree/26_05_08.gpgmedia18_05_08.gpgmedia12_05_08.gpgmedia.
>
>
> The reason is that the media are given as absolute, so the absolute
> path is shown. As you replace '/home/....' the first part of a path
> cannot be replaced, as the path   /home/doug/Doc/Gen/, actually means:
> root / + path home/doug/Doc/Gen/
> In Windows, this would be eg:
> root C:\ + path home/doug/Doc/Gen/
>
> The root part is not part of the string you are replacing.
>
>
>     Running Media Manager again doesn't change it.
>
>     Am I misunderstanding, doing something wrong, or is there a bug?
>
>
> In your case, experiment with the absolute path (you are using that
> now)  and the relative path. The media manager can change between
> those. For string substitution, be carefull, and note that the root
> part is not part of the string you can replace (that is how I remember
> it, however, I can be wrong, didn't check the code, but I would be
> amazed if you could change absolute path (root present) to relative
> path (root not given) with a string substitution).
>
> Let us know if you succeed.
>
> Benny
>
I've tried to sort things out, so my current set-up is as follows:
The /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS directory
contains 26_05_08.gpkg.media and a sub-directory Images with the actual
jpegs.
in Edit-Preferences I've set Base path for relative media paths as
/home/dougb/Documents/Genealogy/Family_Tree/GRAMPS/26_05_08.gpkg.media

I've managed to eliminate the media paths from root and trim the paths
with Media Manager (more or less by nibbling from the ends) down to  
Images/xxx/jpg, Images/yyy.jpg, etc.

However, I don't see the images. I tried 'convert absolute to relative'
(once before removing /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS
and once after) but it only produces a blank 'Affected path'

Wher do I go from here?

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Media manager - 'Replace substring' doesn't work

Benny Malengier


2008/6/8 Doug <[hidden email]>:
I've tried to sort things out, so my current set-up is as follows:
The /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS directory
contains 26_05_08.gpkg.media and a sub-directory Images with the actual
jpegs.
in Edit-Preferences I've set Base path for relative media paths as
/home/dougb/Documents/Genealogy/Family_Tree/GRAMPS/26_05_08.gpkg.media

I've managed to eliminate the media paths from root and trim the paths
with Media Manager (more or less by nibbling from the ends) down to
Images/xxx/jpg, Images/yyy.jpg, etc.

However, I don't see the images. I tried 'convert absolute to relative'
(once before removing /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS
and once after) but it only produces a blank 'Affected path'

Wher do I go from here?

Go to one of the media that don't show, open the media editor, and click after the path name to select a new path.
Write down the original path that did't show
Go to where the media is in the media selector dialog, and select it. Tick the check box at the bottom: Use relative path, then click ok.

Look at the path as GRAMPS understands it should be for a correct relative path. It should be easy to see the difference with your original path that was wrong. Yes?

As soon as you use the media manager to change strings with substitution, it is easy to make an error. Before batch changes; take a backup as .gramps file; or use the family tree manager to store a revision.

Benny


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Media manager - 'Replace substring' doesn't work

Doug-11
Benny Malengier wrote:

>
>
> 2008/6/8 Doug <[hidden email]
> <mailto:[hidden email]>>:
>
>     I've tried to sort things out, so my current set-up is as follows:
>     The /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS directory
>     contains 26_05_08.gpkg.media and a sub-directory Images with the
>     actual
>     jpegs.
>     in Edit-Preferences I've set Base path for relative media paths as
>     /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS/26_05_08.gpkg.media
>
>     I've managed to eliminate the media paths from root and trim the paths
>     with Media Manager (more or less by nibbling from the ends) down to
>     Images/xxx/jpg, Images/yyy.jpg, etc.
>
>     However, I don't see the images. I tried 'convert absolute to
>     relative'
>     (once before removing
>     /home/dougb/Documents/Genealogy/Family_Tree/GRAMPS
>     and once after) but it only produces a blank 'Affected path'
>
>     Wher do I go from here?
>
>
> Go to one of the media that don't show, open the media editor, and
> click after the path name to select a new path.
> Write down the original path that did't show
> Go to where the media is in the media selector dialog, and select it.
> Tick the check box at the bottom: Use relative path, then click ok.
>
> Look at the path as GRAMPS understands it should be for a correct
> relative path. It should be easy to see the difference with your
> original path that was wrong. Yes?
>
> As soon as you use the media manager to change strings with
> substitution, it is easy to make an error. Before batch changes; take
> a backup as .gramps file; or use the family tree manager to store a
> revision.
>
> Benny
>
Benny, thanks a bunch! It just took changing "Images/" to "../Images/"
and all was well.
Doug

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users