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

Where to store media belonging to an imported GedCom file? #8

Closed
IzzySoft opened this issue Feb 18, 2020 · 10 comments
Closed

Where to store media belonging to an imported GedCom file? #8

IzzySoft opened this issue Feb 18, 2020 · 10 comments

Comments

@IzzySoft
Copy link
Contributor

I've imported a GedCom file and see Family Gem would also support media (photos etc) linked to records – that's really cool! Where would I need to store these so they get found and integrated?

@IzzySoft
Copy link
Contributor Author

I've meanwhile managed to trick Family Gem into accepting the media. I doubt this is the intended approach – but until that one gets clear, it might be a good work-around:

  1. Import the GedCom file to Family Gem
  2. In the "Main page" listing available trees, tap the overflow-menu (the "3 stapled buttons") for the tree and select "Info". Note the name of the file, which e.g. is /data/user/0/app.familygem/files/1.json
  3. Again via the overflow menu, select "Save Zip Backup"
  4. Same place, select "Delete"
  5. Add your media to the zip file (including the relative path as used in the GedCom file)
  6. Also add the media to your SD card into Android/data/app.familygem/files/1/ (the files/1 correspond to the path from step 2) using the relative path (yes, this is doing it twice – but adding it just to the Zip didn't work out for me but just yielded errors on import; maybe it's sufficient to just add the media to the card, I didn't test that anymore)
  7. Now, from the main menu, hit the Fav button ("+") and chose "Recover a Zip backup". Pick your new Zip (the one with the media added).

A bit nasty, but it worked for me this way. I guess step 5 can be skipped – but once it worked, I didn't feel to try more. This approach hopefully is a temporary one anyway, there must be an easier one 😄 Meanwhile, leaving these notes in case they prove helpful to someone else.

@michelesalvador
Copy link
Owner

Where would I need to store these so they get found and integrated?

Short answer, in the same Android folder with the Gedcom you import.

Suppose you have a Gedcom with many records containing properties like
FILE C:\Users\Michele\Documents\images\John Doe.jpg
It's a path in the Windows file system and obviously has no meaning in Android.
But Family Gem is smart enough to take the important part John Doe.jpg.

To import the Gedcom with all media files, follow these steps:

  1. Take your Gedcom as is (no need to change any FILE path) and upload it to the folder you prefer of your Android device.
  2. Upload to the same folder John Doe.jpg and all other media files.
  3. From Family Gem import the Gedcom.
  4. That's it, Family Gem will look for John Doe.jpg in that Android folder.

You can see this folder path under Trees > > Info > Media folders.

@IzzySoft
Copy link
Contributor Author

Hm, funny – that was the first thing I tried (with the only difference that I first imported the *.ged and then placed the directory with the images (izzy/*.jpg) exactly where the Gedcom file was imported from. Must have been some caching issue then.

You can see this folder path under Trees > > Info > Media folders.

Yes. And it shows a completely different folder from what you describe: /storage/emulated/0/Android/data/app.familygem/files/1. I don't remember if that was shown there before I did the backup › delete › restore-with-images described above. But maybe it could be edited as well? If so desired, the user then also could change the path here (e.g. if imported the Gedcom file from "Downloads" (and the media path points there) and preferring "things-to-stay" to rather be located in "Documents" (or "Pictures"). Then, having the media placed there, the user can adjust the path and hit the rescan button (which seems to be there already).

@michelesalvador
Copy link
Owner

I reproduced the experiment you described before and actually it works, but you are right, I'd try to make it easier. 😅

Must have been some caching issue then.

I think it's not a caching issue.
As you have guessed, it's simply a matter of matching of relative paths. Maybe your paths didn't match.

Suppose you have the file family.ged with media records containing relative paths such as izzy/myphoto.jpg:

  1. Put this Gedcom file in some folder of Android (e.g. Documents/family.ged).
  2. From Family Gem import it.
  3. Add the directory containing images exactly where the Gedcom file was imported from, so Documents/izzy/*.jpg. Yes, you can do it after too.
  4. Just open your tree and voilà, images.

And it shows a completely different folder from what you describe: /storage/emulated/0/Android/data/app.familygem/files/1

This is the path to the media folder of your tree in the Android external storage.
It's there because you exported and then re-imported a Zip backup (also if tricky way).
Family Gem try to collect all the media files and puts them in a directory named media inside the Zip. Then, when you re-import the backup, all the media are placed into a folder of the external storage, that in your case is /storage/emulated/0/Android/data/app.familygem/files/ + the tree number. Finally this path is put in the media folders list.

But maybe it could be edited as well?

I agree to add the ability to edit the media folders list in InfoMedia folders. Probably the most important here is to be able to add new paths.
At the moment the logic is only that, when you pick a file from the file system, the corresponding directory path is automatically added to the media folders list.

the user can adjust the path and hit the rescan button

I don't understand. What should the button scan for?

@IzzySoft
Copy link
Contributor Author

IzzySoft commented Feb 20, 2020

Actually, those 4 steps was what I tried first (though only with a single JPG) and it didn't seem to work. Maybe I did something wrong, or Family Gem had issues with the sample image I used (I didn't use the real one, I just wanted to figure first where to put things).

Assuming it was my fault then, maybe those instructions should be placed where "Average Joe" can easily find them? Suggestions: Readme, or better: Wiki (you didn't yet start a wiki, but this seems a good time to do so – I'm pretty sure there will be more things to fill the pages, and the Readme then could just point there).

I follow your description that the "external storage location" was set because of backup/restore. But would the images have ended up there if they'd been located in Documents/izzy/*.jpg on backup? That'd be a bit unexpected. Though technical perfectly fine (user can access it using any file manager).

What should the button scan for?

Images? 😄 Remember, I assumed a caching issue. And there is this "recycle" button on the Info screen. What is it supposed to do? When I called up that screen, it said "0 media". After hitting that button, the 0 changed into the real number of media (though none of them was present). Conclusion: when I press this button, it counts media – so maybe it cross-checks with the media location as well. I might have been wrong with that again – but lacking a documentation (which I just proposed to start via the wiki), you must admit it was a good guess 🤣

PS: Would you consider using English comments in the code? That would make it easier for possible contributors. I tried figuring things browsing the code, but with everything being in Italian, including comments, variable and method names, I was completely lost there. Nothing against Italian of course 😉 And before you ask: like @mondstern my native tongue is German, so it's not about "use my language please" but rather finding a "common denominator".

PPS: Where did the translation issue disappear? Was it accidentally made confidential?

@michelesalvador
Copy link
Owner

michelesalvador commented Feb 21, 2020

those 4 steps was what I tried first (though only with a single JPG) and it didn't seem to work.

This is weird.
I just tried again the 4 steps and it works for me.
If you want to help me understand what the problem was, consider kindly retry this procedure.

would the images have ended up there if they'd been located in Documents/izzy/*.jpg on backup?

If I well understand your question, yes.
When you do TreesSave Zip backup, Family Gem collects all the media files that you can see in Media. These files maybe come from different locations of the device, for example Documents/izzy/*.jpg and others. All the collected files are stored in the Zip backup into a single folder named media (with no sub-directories).
Then on restore, all the files are placed in one single folder on the external storage (usually Android/data/app.familygem/files/ + the tree number).
In all the backup/restore process the paths in media records remain unmodified.
Maybe there is something that can be improved? 🤔

And there is this "recycle" button on the Info screen. What is it supposed to do?

If the tree contains more than 100 persons, in Trees and in Info the data (number of persons etc.) are not automatically updated, just to avoid slowdowns, but the button appear to let you refresh the data.
Well, I admit this can be clearer... At least labeling the button Refresh.

PPS: Where did the translation issue disappear? Was it accidentally made confidential?

No. It's @mondstern that vanished from GitHub, and with him the issue he opened.

@IzzySoft
Copy link
Contributor Author

Thanks! That would make a good wiki page already (explaining the backup/restore process) 😃 May I suggest you enable the wiki (see #9) so we can at least use it already to collect documentation pieces? Regardless of where you finally decide to have the documentation, that would make it easier to find pieces we already have.

I currently lack the time to reproduce it. If you say it works for you, I must have had a misspelling somewhere (or some other fault at my end).

No. It's @mondstern that vanished from GitHub, and with him the issue he opened.

Ugh! Indeed 😢 I'll ping him for clarification. Apart from that, I didn't think issues would disappear in such cases. Usually ownership gets transferred to @ghost in such cases, IIRC.

@mondlicht-und-sterne
Copy link
Contributor

i was/ am the one with the translations. with new account.

@michelesalvador
Copy link
Owner

I have moved some content of this issue to the wiki page Import GEDCOM with media files.

@michelesalvador
Copy link
Owner

And the backup process has been synthesized on the wiki page ZIP file backup.

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

No branches or pull requests

3 participants