Difference between revisions of "Addon:Media Verify Tool"

From Gramps
Jump to: navigation, search
(Usage)
(39 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{Third-party plugin}}
 
{{Third-party plugin}}
 
[[File:MediaVerifyTool-default-51.png|thumb|right|450px|Media Verify Tool - dialog - default]]
 
[[File:MediaVerifyTool-default-51.png|thumb|right|450px|Media Verify Tool - dialog - default]]
The {{man label|Media Verify Tool}} is used verify a one-to-one relationship between media objects and files in the media directory. The main purpose of the tool is to locate files that have been moved and fix the paths.
+
The {{man label|Media Verify Tool}} is used verify a one-to-one relationship between media objects and files in the media directory.
  
== Purpose ==
+
The main purpose of the tool is to locate files that have been moved and fix the paths.
  
 
This tool uses [https://en.wikipedia.org/wiki/MD5 MD5 checksums] to verify the integrity of files under the media directory.  It also allows users to use a file manager of their choice to manage media objects.
 
This tool uses [https://en.wikipedia.org/wiki/MD5 MD5 checksums] to verify the integrity of files under the media directory.  It also allows users to use a file manager of their choice to manage media objects.
  
 
== Preparation ==
 
== Preparation ==
 +
[[File:EditPreferences-General-tab-example-51.png|Right|thumb|450px|Preferences - General tab showing the "Base path for relative media paths" setting ]]
  
This tool assumes that you store all your media files under a media directory.  You can specify this directory by setting the {{man label|Base path for relative media paths}} in the {{man label|General}} tab, under the {{man menu|Edit->Preferences}} menu option.
+
The {{man label|Media Verify Tool}} tool assumes that you store all your media files under a media directory.  You can specify this directory by setting the {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Settings#General|Base path for relative media paths]]}} in the {{man label|General}} tab, under the {{man menu|Edit->Preferences}} menu option.
 +
{{-}}
  
 
== Usage ==
 
== Usage ==
Line 15: Line 17:
 
You can access the tool from the {{man menu|Tools > Utilities > Media Verify...}} menu.
 
You can access the tool from the {{man menu|Tools > Utilities > Media Verify...}} menu.
  
Selecting the {{man button|Close}} button will exit the tool.
+
The {{man label|Media Verify Tool}} dialog is display with the following choices:
 +
* The {{man button|Close}} button when selected will exit the tool.
 +
* The {{man button|[[Media_Verify_Tool#Generate|Generate]]}} button will generate MD5 checksums for all media objects.
 +
* The {{man button|[[Media_Verify_Tool#Verify|Verify]]}} button will perform various checks against your media objects in Gramps and media files under your media directory.
 +
* The {{man button|[[Media_Verify_Tool#Export|Export]]}} button when selected will export the report as a text file.
 +
* The {{man button|[[Media_Verify_Tool#Fix|Fix]]}} button will fix the paths in the media objects to match the new paths listed in the {{man button|Verify}} - {{man label|[[Media_Verify_Tool#Moved.2FRenamed_Files|Moved/Renamed Files]]}} section tab.
 +
 
 
{{-}}
 
{{-}}
 
=== Generate ===
 
=== Generate ===
[[File:Results-from-generate-media-verify-tool.png|left]]
+
[[File:Results-from-generate-media-verify-tool.png|right|thumb|550px]]
Clicking the {{man button|Generate}} button will generate MD5 checksums for all media objects.  You should run this after you have added or changed any media files.  Media objects without MD5 checksums will be listed as part of the media verification.
+
Clicking the {{man button|Generate}} button will generate MD5 checksums for all media objects.  You should run this after you have added or changed any media files.  Media objects without MD5 checksums will be listed as part of the media verification.  Resulting {{man label|Errors}} will be displayed in the tab if any.
 
{{-}}
 
{{-}}
  
 
=== Verify ===
 
=== Verify ===
 +
Clicking the {{man button|Verify}} button will perform various checks against your media objects in Gramps and media files under your media directory and display the following section tabs only if that type of issue is present eg:
 +
* {{man label|[[Media_Verify_Tool#Moved.2FRenamed_Files|Moved/Renamed Files]]}} -
 +
* {{man label|[[Media_Verify_Tool#Missing_Files|Missing Files]]}} -
 +
* {{man label|[[Media_Verify_Tool#Duplicate_Files|Duplicate Files]]}} -
 +
* {{man label|[[Media_Verify_Tool#Extra_Files_Files|Extra Files Files]]}} -
 +
* {{man label|[[Media_Verify_Tool#No_MD5_Generated|No MD5 Generated]]}} -
  
Clicking the {{man button|Verify}} button will perform various checks against your media objects in Gramps and media files under your media directory.
+
{{-}}
 
 
 
==== Moved/Renamed Files ====
 
==== Moved/Renamed Files ====
 
+
[[File:MediaVerifyTool1.png|thumb|right|550px|]]
[[Image:MediaVerifyTool1.png]]
 
  
 
Files that have moved or renamed are listed in the {{man label|Moved/Renamed Files}} tab.  Where there are multiple files with the same checksum under the media directory, the first one listed with the same name as the original will be displayed.
 
Files that have moved or renamed are listed in the {{man label|Moved/Renamed Files}} tab.  Where there are multiple files with the same checksum under the media directory, the first one listed with the same name as the original will be displayed.
  
 
Double clicking on a row will edit the associated media object.
 
Double clicking on a row will edit the associated media object.
 
+
{{-}}
 
==== Missing Files ====
 
==== Missing Files ====
 
+
[[File:MediaVerifyTool2.png|thumb|right|550px|]]
[[Image:MediaVerifyTool2.png]]
 
  
 
Media objects are listed in the {{man label|Missing Files}} tab, when there is no file found with a matching checksum.
 
Media objects are listed in the {{man label|Missing Files}} tab, when there is no file found with a matching checksum.
  
 
Double clicking on a row will edit the associated media object.
 
Double clicking on a row will edit the associated media object.
 
+
{{-}}
 
==== Duplicate Files ====
 
==== Duplicate Files ====
 
+
[[File:MediaVerifyTool3.png|thumb|right|550px|]]
[[Image:MediaVerifyTool3.png]]
 
  
 
Files with duplicate checksums are listed in the {{man label|Duplicate Files}} tab.
 
Files with duplicate checksums are listed in the {{man label|Duplicate Files}} tab.
  
 
Double clicking on a row will display the image in the default viewer.
 
Double clicking on a row will display the image in the default viewer.
 
+
{{-}}
==== Extra Files Files ====
+
==== Extra Files ====
 
+
[[File:MediaVerifyTool4.png|thumb|right|550px|]]
[[Image:MediaVerifyTool4.png]]
 
  
 
Files that are under the media directory, but not yet in Gramps are listed in the {{man label|Extra Files}} tab.
 
Files that are under the media directory, but not yet in Gramps are listed in the {{man label|Extra Files}} tab.
  
 
Double clicking on a row will display the image in the default viewer.
 
Double clicking on a row will display the image in the default viewer.
 +
{{-}}
  
 
==== No MD5 Generated ====
 
==== No MD5 Generated ====
 
+
[[File:MediaVerifyTool5.png|thumb|right|550px|]]
[[Image:MediaVerifyTool5.png]]
 
  
 
Media objects with no checksum are listed in the {{man label|No MD5 Generated}} tab.
 
Media objects with no checksum are listed in the {{man label|No MD5 Generated}} tab.
  
 
Double clicking on a row will edit the associated media object.
 
Double clicking on a row will edit the associated media object.
 +
{{-}}
  
 
=== Export ===
 
=== Export ===
  
Clicking the {{man button|Export}} button will export the report as a text file.
+
Clicking the {{man button|Export}} button will show the {{man label|Export results to a text file}} dialog so you can save the report.
 +
 
 +
==== Example results text file ====
 +
The results text file when viewed will show each type of issue displayed in its own section.
 +
 
 +
<pre>
 +
Missing Files
 +
    1897_expeditionsmannschaft_rio_a.jpg
 +
    Gunnlaugur_Larusson_-_Yawn.jpg
 +
    654px-Aksel_Andersson.jpg
 +
    Alimehemet.jpg
 +
    E_W_Dahlgren.jpg
 +
    AntoineClaudet.png
 +
    scanned_microfilm.png
 +
</pre>
  
 
=== Fix ===
 
=== Fix ===
  
Clicking the {{man button|Fix}} button will fix the paths in the media objects to match the new paths listed in the {{man label|Moved/Renamed Files}} section.
+
Clicking the {{man button|Fix}} button will fix the paths in the media objects to match the new paths listed in the listed in the {{man button|Verify}} - {{man label|[[Media_Verify_Tool#Moved.2FRenamed_Files|Moved/Renamed Files]]}} section tab.
 +
 
 +
== See also==
 +
* The builtin {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Tools#Media_Manager|Media Manager]]}} which is group of four separate tools that allows you to do the following:
 +
** {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Tools#Replace_substrings_in_the_path|Replace substrings in the path]]}}
 +
** {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Tools#Convert_paths_from_relative_to_absolute|Convert paths from relative to absolute]]}}
 +
** {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Tools#Convert_paths_from_absolute_to_relative|Convert paths from absolute to relative]]}}
 +
** {{man label|[[Gramps_{{man version}}_Wiki_Manual_-_Tools#Add_images_not_included_in_database|Add images not included in database]]}}
 +
 
 +
* The Third-party Addon {{man label|[[Addon:MediaMerge|Merge Media]]}} that searches your database for media file entries that are pointing to the same actual file and when found, they can be merged together.
 +
 
 +
* [[Media Management]]
  
 
== Issues ==
 
== Issues ==
 +
* Add a help button pointing here
 
* {{bug|7144}} Media Verify: wrong handling of non-ascii characters
 
* {{bug|7144}} Media Verify: wrong handling of non-ascii characters
 
* {{bug|6744}} Add Merge for Media Verify Plugin
 
* {{bug|6744}} Add Merge for Media Verify Plugin
Line 85: Line 121:
 
* Removing unused duplicate files.
 
* Removing unused duplicate files.
 
* Creating media objects for unused files.
 
* Creating media objects for unused files.
* Add a help button pointing here
 
 
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 
[[Category:Developers/General]]
 
[[Category:Developers/General]]
 +
[[Category:Media]]

Revision as of 22:34, 2 November 2020

Gramps-notes.png

Please use carefully on data that is backed up, and help make it better by reporting any comments or problems to the author, or issues to the bug tracker
Unless otherwise stated on this page, you can download this addon by following these instructions.
Please note that some Addons have prerequisites that need to be installed before they can be used.
This Addon/Plugin system is controlled by the Plugin Manager.

Media Verify Tool - dialog - default

The Media Verify Tool is used verify a one-to-one relationship between media objects and files in the media directory.

The main purpose of the tool is to locate files that have been moved and fix the paths.

This tool uses MD5 checksums to verify the integrity of files under the media directory. It also allows users to use a file manager of their choice to manage media objects.

Preparation

Preferences - General tab showing the "Base path for relative media paths" setting

The Media Verify Tool tool assumes that you store all your media files under a media directory. You can specify this directory by setting the Base path for relative media paths in the General tab, under the Edit->Preferences menu option.

Usage

Media Verify Tool - dialog - default

You can access the tool from the Tools > Utilities > Media Verify... menu.

The Media Verify Tool dialog is display with the following choices:

  • The Close button when selected will exit the tool.
  • The Generate button will generate MD5 checksums for all media objects.
  • The Verify button will perform various checks against your media objects in Gramps and media files under your media directory.
  • The Export button when selected will export the report as a text file.
  • The Fix button will fix the paths in the media objects to match the new paths listed in the Verify - Moved/Renamed Files section tab.


Generate

Results-from-generate-media-verify-tool.png

Clicking the Generate button will generate MD5 checksums for all media objects. You should run this after you have added or changed any media files. Media objects without MD5 checksums will be listed as part of the media verification. Resulting Errors will be displayed in the tab if any.

Verify

Clicking the Verify button will perform various checks against your media objects in Gramps and media files under your media directory and display the following section tabs only if that type of issue is present eg:


Moved/Renamed Files

MediaVerifyTool1.png

Files that have moved or renamed are listed in the Moved/Renamed Files tab. Where there are multiple files with the same checksum under the media directory, the first one listed with the same name as the original will be displayed.

Double clicking on a row will edit the associated media object.

Missing Files

MediaVerifyTool2.png

Media objects are listed in the Missing Files tab, when there is no file found with a matching checksum.

Double clicking on a row will edit the associated media object.

Duplicate Files

MediaVerifyTool3.png

Files with duplicate checksums are listed in the Duplicate Files tab.

Double clicking on a row will display the image in the default viewer.

Extra Files

MediaVerifyTool4.png

Files that are under the media directory, but not yet in Gramps are listed in the Extra Files tab.

Double clicking on a row will display the image in the default viewer.

No MD5 Generated

MediaVerifyTool5.png

Media objects with no checksum are listed in the No MD5 Generated tab.

Double clicking on a row will edit the associated media object.

Export

Clicking the Export button will show the Export results to a text file dialog so you can save the report.

Example results text file

The results text file when viewed will show each type of issue displayed in its own section.

Missing Files
    1897_expeditionsmannschaft_rio_a.jpg
    Gunnlaugur_Larusson_-_Yawn.jpg
    654px-Aksel_Andersson.jpg
    Alimehemet.jpg
    E_W_Dahlgren.jpg
    AntoineClaudet.png
    scanned_microfilm.png

Fix

Clicking the Fix button will fix the paths in the media objects to match the new paths listed in the listed in the Verify - Moved/Renamed Files section tab.

See also

  • The Third-party Addon Merge Media that searches your database for media file entries that are pointing to the same actual file and when found, they can be merged together.

Issues

  • Add a help button pointing here
  • 7144 Media Verify: wrong handling of non-ascii characters
  • 6744 Add Merge for Media Verify Plugin

Possible future enhancements

This tool could be enhanced to perform other tasks, such as:

  • Merging media objects with duplicate files.
  • Updating the checksum for modified files.
  • Removing unused duplicate files.
  • Creating media objects for unused files.