From 379959447373f951ffca372598ea8f1d5834fe52 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Mon, 18 Jan 2021 08:55:44 -0800 Subject: [PATCH] Beta fix for Digikam reading XMP --- osxphotos/_version.py | 2 +- osxphotos/templates/xmp_sidecar_beta.mako | 178 ++++++++++++---------- 2 files changed, 101 insertions(+), 79 deletions(-) diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 9e639118..7684f6e2 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.39.21" +__version__ = "0.39.22" diff --git a/osxphotos/templates/xmp_sidecar_beta.mako b/osxphotos/templates/xmp_sidecar_beta.mako index 60bb3ac0..70fc362a 100644 --- a/osxphotos/templates/xmp_sidecar_beta.mako +++ b/osxphotos/templates/xmp_sidecar_beta.mako @@ -16,7 +16,7 @@ % else: - ${desc | x} + ${desc | x} % endif @@ -43,7 +43,7 @@ % for subj in subject: - ${subj | x} + ${subj | x} % endfor @@ -59,11 +59,11 @@ <%def name="iptc_personinimage(persons)"> % if persons: - - % for person in persons: - ${person | x} - % endfor - + + % for person in persons: + ${person | x} + % endfor + % endif @@ -71,11 +71,11 @@ <%def name="dk_tagslist(keywords)"> % if keywords: - - % for keyword in keywords: - ${keyword | x} - % endfor - + + % for keyword in keywords: + ${keyword | x} + % endfor + % endif @@ -105,37 +105,44 @@ % endif -<%def name="face_regions(photo)"> +<%def name="mwg_face_regions(photo)"> % if photo.face_info: - - - - % for face in photo.face_info: - - - - - - % endfor - - + + pixel + + + + % for face in photo.face_info: + + + ${'{0:.6f}'.format(face.mwg_rs_area.h)} + ${'{0:.6f}'.format(face.mwg_rs_area.w)} + ${'{0:.6f}'.format(face.mwg_rs_area.x)} + ${'{0:.6f}'.format(face.mwg_rs_area.y)} + normalized + + ${face.name} + ${face.roll} + Face + + % endfor + + + % endif + + +<%def name="mpri_face_regions(photo)"> + % if photo.face_info: % for face in photo.face_info: - + + ${face.name} + ${'{0:.6f}'.format(face.mpri_reg_rect.x)}, ${'{0:.6f}'.format(face.mpri_reg_rect.y)}, ${'{0:.6f}'.format(face.mpri_reg_rect.h)}, ${'{0:.6f}'.format(face.mpri_reg_rect.w)} + % endfor @@ -143,46 +150,61 @@ % endif + + - - - ${photoshop_sidecar_for_extension(extension)} - ${dc_description(description)} - ${dc_title(photo.title)} - ${dc_subject(subjects)} - ${dc_datecreated(photo.date)} - - - ${iptc_personinimage(persons)} - - - ${dk_tagslist(keywords)} - - - ${adobe_createdate(photo.date)} - ${adobe_modifydate(photo.date)} - - - ${gps_info(*photo.location)} - - - ${orientation(photo.orientation)} - - - ${face_regions(photo)} - - - \ No newline at end of file + + + ${photoshop_sidecar_for_extension(extension)} + ${dc_description(description)} + ${dc_title(photo.title)} + ${dc_subject(subjects)} + ${dc_datecreated(photo.date)} + + + + ${iptc_personinimage(persons)} + + + + ${dk_tagslist(keywords)} + + + + ${adobe_createdate(photo.date)} + ${adobe_modifydate(photo.date)} + + + + ${gps_info(*photo.location)} + + + + ${orientation(photo.orientation)} + + + + ${mwg_face_regions(photo)} + + + + + ${mpri_face_regions(photo)} + + + + + \ No newline at end of file