* Media directory name - case issue

AS allows faster and more convenient creation of source records for Family Historian.
Post Reply
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Media directory name - case issue

Post by jelv »

I'm using the default media directory (xxx.fh_data\Media) for all media - as is normal on Windows the M of Media is upper case. If I add media using FH, the file name in the media sources window is Media\mediafilename with an upper case M. However media added using AS when I say use the destination folder if copying of Default location (project media folder root) is copied to the correct directory but in the FH media record the file name is media\mediafilename with a lower case m.

This doesn't matter in FH, the media displays correctly, but I am exporting the data using the Export Gedcom File plugin (v3.9) with the Multimedia Conversion set to (FILE~REL) Multimedia via Relative Link Records. This I am then loading in to Webtrees on a Linux based server. On Linux Media and media are different directories so I am copying the media files to a sub-directory called Media to match the FH directory name. This means that Webtrees cannot find the media added by AS as the path is incorrect. To address this I am having to use a case sensitive search and replace using a text editor on the Gedcom file to replace media\ with Media\ before loading it in to Webtrees.

Why isn't AS using the correct case for the directory name when creating the media record? Is there a fix to this that could be applied?

Also, would it be possible for the Export Gedcom File to have an option to output paths relative to the Media folder?
John Elvin
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media directory name - case issue

Post by tatewise »

I can change the xxx.fh_data\Media folder to xxx.fh_data\media and back again.
In Windows File Explorer it always correctly shows Media or media as appropriate.
As you say, FH is not case sensitive regarding filenames.

For me, AS always uses Media or media to match the actual Windows folder name.

So can you double-check whether you really are using Media or media for that folder name in this Project?

Regarding Export Gedcom File output paths relative to the Media folder...
(FILE~REL) Multimedia via Relative Link Records already puts relative paths in the Media Records.

Perhaps you want it to retain the folder structure below the Media folder?
If so, then tick the Keep Media folders option lower right on the Basic Options tab.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Media directory name - case issue

Post by jelv »

Thanks for the quick response. This is my directory structure:
FH directory structure.png
FH directory structure.png (6.95 KiB) Viewed 5620 times

(FILE~REL) Multimedia via Relative Link Records is outputting relative to xxx.fh_data, not relative to xxx.fh_data\Media which would resolve the issue. Here's an extract from the exported Gedcom showing something recently added via AS:
0 @O134@ OBJE
1 FILE media\Elvin, Angelina - baptism GBPRS_NORFOLK_PD-437-100_PD-437-100-017.jpg
2 TITL Elvin, Angelina - baptism GBPRS_NORFOLK_PD-437-100_PD-437-100-017
2 FORM jpg
1 NOTE Media Date: 28 FEB 1841
2 CONT Keywords: Baptism
1 CHAN
2 DATE 2 MAY 2020
3 TIME 21:40:37
John Elvin
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Media directory name - case issue

Post by jelv »

Mike, browsing around I've just found the file ASProjectOptions.xml in which I found several entries looking like this:
<Key Name="01">
<Value Name="CopyToImagePath" Value="media" />
<Value Name="CopyToImagePath" Value="media" Computer="ELVIN11" />
<Value Name="ImagePath" Value="C:\temp" />
<Value Name="ImagePath" Value="C:\temp" Computer="ELVIN11" />
<Value Name="CopyToImagePath" Value="" Computer="ACERLAPTOP" />
<Value Name="ImagePath" Value="P:\Family Tree\Documents - new" Computer="ACERLAPTOP" />
</Key>
Is the fact that media vales have lower case m significant?
John Elvin
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media directory name - case issue

Post by tatewise »

Yes, try changing all those media to Media using a plain text editor.

(FILE~REL) Multimedia via Relative Link Records has to be relative to xxx.fh_data to be compatible with FH.

I could look at adding an Export Gedcom File feature to ensure Record Media links match the Media folder capitalisation.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Media directory name - case issue

Post by davidf »

Linux filenames (and folder names) are case significant. Windows 10 can be set to allow case significant file (and presumably folder) names. (ref: https://www.howtogeek.com/354220/how-to ... indows-10/)

How this impacts on emulators and virtual machines particularly if the emulated/virtual program looks to the host (say linux) filesystem for its data is not entirely clear. I imagine it will depend on the emulator and possibly on the program.

Does anyone on Windows 10 want to find out what happens if they make their file system case significant (e.g. you have co-existing Media and media folders)? If that causes problems, I think we have something for Calico Pie to look at; if not it would be for the VM/Emulator developers to look at (or for users to be very careful)!.
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Media directory name - case issue

Post by jelv »

tatewise wrote: 13 May 2020 16:14 (FILE~REL) Multimedia via Relative Link Records has to be relative to xxx.fh_data to be compatible with FH.
What about a check box (off by default) that was only applicable to the FILE~REL option to remove the Media\ from the start of the name (but still worked with Keep Media folders)?
tatewise wrote: 13 May 2020 16:14 I could look at adding an Export Gedcom File feature to ensure Record Media links match the Media folder capitalisation.
That sounds sensible.

Just found another thing interesting: FILE~ABS corrects the capitalisation on the full path! Webtrees has an option to strip a path you specify from the file names when doing the import - I couldn't use that before as there were two different paths.
John Elvin
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media directory name - case issue

Post by tatewise »

Strictly speaking the FILE~ABS conversion maps [Mm]edia to fullpath\Media regardless of the actual capitalisation of the Project's Media folder.

The next version of the Plugin should take account of the actual Media folder name for both FILE~ABS and FILE~REL.

In the meantime try the attached Export Gedcom File Plugin Version 3.9.2 Date 13 May 2020 ZIP file.
It has a quick fix for FILE~REL that converts media links to Media.
You must unpack the ZIP file and install the resulting Plugin as usual.
[ EDIT attachment deleted as in Plugin Store ]
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Media directory name - case issue

Post by jelv »

3.9.2 worked a treat - thankyou. 8-)
tatewise wrote: 13 May 2020 16:14 Yes, try changing all those media to Media using a plain text editor.
I tried this - no difference - it still created the media record with lower case m.
John Elvin
User avatar
NickWalker
Megastar
Posts: 2608
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Media directory name - case issue

Post by NickWalker »

I know this is an old topic but just to let you know that the next version of AS will correctly record this folder as 'Media' rather than 'media'.

Best wishes

Nick
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/
Post Reply