+ # EXIF extraction
+ exif_tags = extract_exif(queued_filename)
+ gps_data = get_gps_data(exif_tags)
+
+ # Always create a small thumbnail
+ thumb_filepath = create_pub_filepath(
+ entry, name_builder.fill('{basename}.thumbnail{ext}'))
+ resize_image(entry, queued_filename, thumb_filepath,
+ exif_tags, conversions_subdir,
+ (mgg.global_config['media:thumb']['max_width'],
+ mgg.global_config['media:thumb']['max_height']))
+
+ # If the size of the original file exceeds the specified size of a `medium`
+ # file, a `.medium.jpg` files is created and later associated with the media
+ # entry.
+ medium = Image.open(queued_filename)
+ if medium.size[0] > mgg.global_config['media:medium']['max_width'] \
+ or medium.size[1] > mgg.global_config['media:medium']['max_height'] \
+ or exif_image_needs_rotation(exif_tags):
+ medium_filepath = create_pub_filepath(
+ entry, name_builder.fill('{basename}.medium{ext}'))
+ resize_image(
+ entry, queued_filename, medium_filepath,
+ exif_tags, conversions_subdir,
+ (mgg.global_config['media:medium']['max_width'],
+ mgg.global_config['media:medium']['max_height']))
+ else:
+ medium_filepath = None
+
+ # Copy our queued local workbench to its final destination
+ proc_state.copy_original(name_builder.fill('{basename}{ext}'))