@@ -0,0 +1,1529 @@
+from voussoirkit import imagetools%0Afrom voussoirkit import vlogging%0A%0Avlogging.basic_config(vlogging.INFO)%0A%0Aimport etiquette%0A%0AP = etiquette.photodb.PhotoDB()%0A%0Awith P.transaction:%0A    try:%0A        CAMERA = P.get_tag('camera')%0A    except etiquette.exceptions.NoSuchTag:%0A        CAMERA = P.new_tag('camera')%0A%0A    try:%0A        LENS = P.get_tag('lens')%0A    except etiquette.exceptions.NoSuchTag:%0A        LENS = P.new_tag('lens')%0A%0A    for photo in P.search(extension=%5B'jpeg', 'jpg'%5D, yield_albums=False):%0A        if not photo.real_path.exists:%0A            continue%0A        exif = imagetools.exifread(photo.real_path)%0A        camera_make = exif.get('Image Make')%0A        camera_model = exif.get('Image Model')%0A        camera_make = camera_make.values if camera_make else ''%0A        camera_model = camera_model.values if camera_model else ''%0A        camera = ' '.join(%5Bcamera_make, camera_model%5D).strip().replace('.', '')%0A        lens = exif.get('EXIF LensModel')%0A        lens = (lens.values if lens else '').replace('.', '')%0A        if camera:%0A            try:%0A                camera_tag = P.get_tag(camera)%0A            except etiquette.exceptions.NoSuchTag:%0A                camera_tag = P.new_tag(camera)%0A                CAMERA.add_child(camera_tag)%0A            photo.add_tag(camera_tag)%0A        if lens:%0A            try:%0A                lens_tag = P.get_tag(lens)%0A            except etiquette.exceptions.NoSuchTag:%0A                lens_tag = P.new_tag(lens)%0A                LENS.add_child(lens_tag)%0A            photo.add_tag(lens_tag)%0A

Add tag_exif_camera_lens.py utility.