First: I like GRAMPS . And I really like discourse. I knew this platform from the very first steps and it’s great!
Now, my question. Is there any way to force GRAMPS to reload a media file (image)? I noted that if I change the image on the hard disk (eg. cropping or exchanging against a better picture) GRAMPS often didn’t realize that. So I have to rename the picture and have to select the changed one.
Hagen from Germany
When you add an image to a Gramps record, it creates a checksum from the raw image file that is stored internally within Gramps. If you alter the file, as you note, there is a conflict with the checksum.
Any time you run the Check & Repair tool, these checksums will be updated. Tools >> Family Tree Repair >> Check and Repair Database.
There is also the Media Verify Tool. Tool >> Utilities >> Media Verify
This tool will scan all media files in your media directory and compare it to media records in Gramps. These checksum mismatches will show as missing raw files for the Gramps records and extra files in the media folders. The Fix will bring these files back together with the records.
The quickest way is to drag (using the mouse) the changed file from its location to the Gallery you wish it to appear in. This creates a new Media record. You can then delete the old media from the Gallery.
Has anybody used the Thumbnail Generator tool? Searching the wiki doesn’t say what it does. [Wiki updated Aug 2021: Thumbnail Generator] But it’s been there since generation 3.
Maybe it flushes & rebuilds all the Thumbnails?
I use it.
It populates all the thumbnails so that as you navigate, there is no lag time as these need to be generated. Periodically I will run the tool and it will generate the missing thumbnails. To see this lag, go to your media list with the gallery tab selected in the bottom bar then use the up or down arrow to navigate the list.
And I always run it after making major changes to my media file/folder structure. When I do this, I delete the existing thumbnails stored in the user files and then run the tool to repopulate the thumbnails.
It used to take many hours (I ran it overnight for 21K media files) after a major change. It now takes an hour to do a complete rebuild. Obviously fewer files equals less time. Doing it as an ongoing maintenance is much faster as it only does the missing thumbnails.
This will generate the new thumbnails for cropped of better saved images as Hagen experiences but does not solve the checksum issue.
And no, it does not flush the thumbnails before a rebuild.
A Wiki page has just been added for the Thumbnail Generator tool
It is noted that (since Gramps 2.0.7) contextual thumbnails for non-standard (image) filetypes are only added if:
- the OS has an application associated with the file/MIME type, and
- that application generates thumbnails instead of generic file type icons
When first added in 2005, the support docs only mentioned Linux tools:
What (free) applications can be installed for Windows and macOS that will give Gramps the ability to generate thumbnails for PDF media?
Gramps first trys to generate a thumbnail with the built-in Gtk libraries. These can handle many usual image types. If this fails, it tries to use the Linux tools you mention to generate a thumbnail by spawning a command to do this. Since Windows doesn’t have these tools, this is disabled to save the time looking for the command for every thumbnail.
For Mac, it is possible that it might be able to get the appropriate tools and their mime database onto your system, but I have no way to test this. Gramps uses a hard wired path to find the mime database that looks suspicious to me, I have to wonder if this even works on Linux systems these days.
The Gramps code for this stuff is in gen/utils/thumbnails.py.
It looks like preview-generator 0.23 in PyPI might do more MIME types. It even has an option to specify something different than PDF page#0 as the basis for the thumbnail. But it is MIT license and requires Python 3.5 or better.
And it also looks like Windows or macOS users would have to use a virtual environment.
Maybe something could be written to peruse the list of Media objects and generate the expected size of thumbnails? Or maybe a report could generate a script for batch operation of Preview-Generator?
But it might be an interesting experiment if it somehow could talk to Gramps. I’m not aware of any example of external applications used to modify Gramps data. There are tools (like Betty) that will use a Gramps XML as a data source. But I have not discovered one that writes back to the XML file or database.