Fixed thumbnail reload on metadata change

This commit is contained in:
Ignacio Serantes
2026-04-06 22:09:13 +02:00
parent a717acef87
commit 45c95c1bb1
4 changed files with 108 additions and 36 deletions

View File

@@ -15,10 +15,11 @@ Dependencies:
- utils.preserve_mtime: A utility to prevent file modification times from
changing during metadata writes.
"""
from importlib.resources import path
import os
import re
from utils import preserve_mtime
from metadatamanager import notify_baloo
from metadatamanager import notify_baloo, mark_app_modified
try:
import exiv2
except ImportError:
@@ -38,8 +39,9 @@ class XmpManager:
This method parses the XMP data structure for a `mwg-rs:RegionList`,
extracts all regions of type 'Face', and returns them as a list of
dictionaries. Each dictionary contains the face's name and its
normalized coordinates (center x, center y, width, height).
dictionaries.
Each dictionary contains the face's name and its normalized coordinates
(center x, center y, width, height).
Args:
path (str): The path to the image file.
@@ -161,7 +163,9 @@ class XmpManager:
xmp[f"{area_base}/stArea:unit"] = 'normalized'
img.writeMetadata()
notify_baloo(path)
mark_app_modified(path)
return True
except Exception as e:
print(f"Error saving faces to XMP: {e}")