add: resize imgs with imagemagick

main
rrr-marble 5 years ago
parent 0330e1bc5b
commit fc81b97891

@ -32,8 +32,19 @@ def process_pictures():
# skip any non-image files
if not filetype.image_match(path.join(root, filename)):
continue
# process it with imagemagick
# move them to the processed folder
# process pictures with wand lib, imagemagick wrapper
exif = {}
with Image(filename=path.join(root, filename)) as image:
exif.update(
(k[5:], v) for k, v in image.metadata.items() if k.startswith("exif:")
)
with image.clone() as cloned:
cloned.strip() # Q: may damage icc, do we allow that or use smh else?
cloned.transform(resize="50%") # Q: what do we want here?
# move them to the processed folder
cloned.save(filename=path.join(DEST_STRUNK, filename))
# update the database
pass

Loading…
Cancel
Save