summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-09-13 18:32:20 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-09-13 18:32:20 +0200
commita355b97e8ee5a8cf584e51cdc99f7439f8930491 (patch)
tree0081f2a6ee2c10e317d1c5688dc4c89651375c6f
parent5fb64e32a89e8cea0d3d3adfc0159a7dcf506854 (diff)
Load image before mogrify; get GPS in main thread (caching; lower load)HEADmain
-rwxr-xr-xbin/pyggle21
1 files changed, 11 insertions, 10 deletions
diff --git a/bin/pyggle b/bin/pyggle
index cc43365..5032f3b 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -777,6 +777,15 @@ def _make_thumbnail(args):
print(f"Cannot load image '{filename}': {e}", file=sys.stderr)
return None, None
+ thumbnail = Thumbnail(
+ filename,
+ im_copy,
+ size=args.size,
+ group_key_template=args.group,
+ file_key_template=args.group_files,
+ **thumb_arg,
+ )
+
if (
args.edit_in_place
and args.resize
@@ -791,16 +800,6 @@ def _make_thumbnail(args):
]
)
- thumbnail = Thumbnail(
- filename,
- im_copy,
- size=args.size,
- with_gps=args.with_nominatim,
- group_key_template=args.group,
- file_key_template=args.group_files,
- **thumb_arg,
- )
-
exiftool_args = list()
if args.caption_to_exif and thumbnail.html.caption:
@@ -966,6 +965,8 @@ if __name__ == "__main__":
for filename, thumbnail in raw_thumbnails:
if thumbnail is not None:
+ if args.with_nominatim:
+ thumbnail._get_gps()
thumbnails.append(thumbnail)
for kept_thumbnail in thumbnail.kept_thumbnails:
rm_thumbnail.pop(kept_thumbnail)