Before asking for help please read "How to request help" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

[Solved] Replacement of media 1 month 4 weeks ago #1

  • Klugesherz
  • Klugesherz's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 104
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.0.7 ---> My famility tree
Attachments:

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

Last edit: by Klugesherz.

Replacement of media 1 month 4 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Replacement of media 1 month 4 weeks ago #3

  • Klugesherz
  • Klugesherz's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 104
Easy :-)

Thank you
WebTrees 2.0.7 ---> My famility tree

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

Replacement of media 1 month 4 weeks ago #4

  • Klugesherz
  • Klugesherz's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 104
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.0.7 ---> My famility tree

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

Replacement of media 1 month 4 weeks ago #5

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Replacement of media 1 month 4 weeks ago #6

  • Klugesherz
  • Klugesherz's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 104

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.0.7 ---> My famility tree

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

Replacement of media 1 month 4 weeks ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
> 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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Replacement of media 1 month 4 weeks ago #8

  • Klugesherz
  • Klugesherz's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 104
Perfect !
Great approach with great sens.

Thank you for your help.
WebTrees 2.0.7 ---> My famility tree

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

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 
  • Page:
  • 1
Powered by Kunena Forum