Unverified Commit a355b97e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Load image before mogrify; get GPS in main thread (caching; lower load)

parent 5fb64e32
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -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)