Web based family history software

Question Replacement of media

  • Klugesherz
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago - 3 years 9 months ago #1 by Klugesherz
[Solved] Replacement of media was created by Klugesherz
Hello,

My question might have been asked several times, however..
Is there an easy way to replace a Media, without having to delete the file ?
In the Menu "Modify" you can only delete the file, but not reload a new one.



Suppose, that after have linked a "photo id" to different individuals, you are able to find a photo with a better quality.
And, you have decided to replace the photo in WebTrees.
What is the best approach ?

Based on my understanding, by deleting the media, I guess
  • that the "media id" link will be broken to all individuals.
  • Also that the media file will be removed from the data directory.

Afterwards, once the new photo is transferred to WebTrees, You have to modify each individual, to link to the new media.


The workaround, would be to directly replace the file via ftp, and to rename the new file with the same name that the former.

Is there another possibility ?

Merci d'avance

Christian

WebTrees 2.1.x---> My famility tree
PHP 8.0
Attachments:
Last edit: 3 years 9 months ago by Klugesherz.

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago #2 by fisharebest
Replied by fisharebest on topic Replacement of media
A media object can contain more than one media file.

The solution is to temporarily have two media files.

1) Add the new (high quality) media file to the media object
2) Remove the old (low quality) media file from the media object

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Klugesherz
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #3 by Klugesherz
Replied by Klugesherz on topic Replacement of media
Easy :-)

Thank you

WebTrees 2.1.x---> My famility tree
PHP 8.0

Please Log in or Create an account to join the conversation.

  • Klugesherz
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #4 by Klugesherz
Replied by Klugesherz on topic Replacement of media
Perhaps one supplementary question which is not clear for me.

What about the "file name", and how it is addressed by WebTrees

When I'm using an "unique file name"
If I upload twice the same file :
"Paul Klugesherz 26-08-1895.jpg"
does webtrees will generate 2 different hashed files on data repository ?

This would be perfect, and simplify my task, because it is not easy to identify the right "file name",
and I prefer to identify the file with the note "field"

Thank you

WebTrees 2.1.x---> My famility tree
PHP 8.0

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago #5 by fisharebest
Replied by fisharebest on topic Replacement of media
The unique name is created from the file's contents.

> If I upload twice the same file :
> "Paul Klugesherz 26-08-1895.jpg"

Same file or same filename?


If these two files contain identical images, then they will have the same unique name, (and the two media objects will use the same media file).

For example, if you have a photograhp of two brothers, you can have two media objects with the same file and different titles.
"Peter (left) with his brother John"
"John (right) with his brother Peter"


If these files contain different images, then they will have different unique names.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Klugesherz
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #6 by Klugesherz
Replied by Klugesherz on topic Replacement of media

fisharebest wrote: > If I upload twice the same file :
> "Paul Klugesherz 26-08-1895.jpg"
Same file or same filename?


Same file name.

Although you have provided the solution to fix my question via : "to temporarily have two media files."

Suppose I added 1 photo to the individual: Paul Klugesherz
File name of his picture is : "Paul Klugesherz 26-08-1895.jpg"
The choice for upload = "Keep unique file name" --> file name is hashed on the data directory

Some days later, I decide to upload a better quality of photo, through control panel: I upload a new media
The file contents is not the same, because better quality
But I decide on my computer to use the same file name : "Paul Klugesherz 26-08-1895.jpg"

When I upload the new file to WebTrees, does WebTrees will generate a new hashed "file name" because hash computation is based on the full information:
* contents of the file + note + file name + ..
or only
* file name:
In the last case, I would obtain the same hashed result.

Sorry, to bother you, I could of course make the test my self, but just to know how the hash is computed


In fact, not to choose the option "unique file name" would create a conflict.

Merci

WebTrees 2.1.x---> My famility tree
PHP 8.0

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago #7 by fisharebest
Replied by fisharebest on topic Replacement of media
> When I upload the new file to WebTrees, does WebTrees will generate a new hashed "file name" because hash computation is based on the full information:
> * contents of the file + note + file name + ..
> or only
> * file name:

No. The hash uses only the contents of the file.

> In fact, not to choose the option "unique file name" would create a conflict.

If you upload a file, and there exists a file with the same name,
then webtrees will automatically enable the "unique name" option.

This prevents you from overwriting data.

For example, if two users upload a file with the name "grandpa.jpeg", the second one will be given a new/unique name


But what if a file already exists with the same unique name?
It must be the same file (it has the same contents)
So webtrees will re-use the existing image.
You will now have two media objects that use the same file.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Klugesherz
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #8 by Klugesherz
Replied by Klugesherz on topic Replacement of media
Perfect !
Great approach with great sens.

Thank you for your help.

WebTrees 2.1.x---> My famility tree
PHP 8.0

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}