Fix for [Bug with exempi 2.5.0 #1]
With exempi 2.5.0 when the get_property was called on an unset one, it crashed with "unkown error". Fix with checking if property exists before actually getting the property
This commit is contained in:
@@ -1102,7 +1102,11 @@ for xmp_file in work_files:
|
|||||||
# read fields from the XMP file and store in hash
|
# read fields from the XMP file and store in hash
|
||||||
xmp.parse_from_str(strbuffer)
|
xmp.parse_from_str(strbuffer)
|
||||||
for xmp_field in xmp_fields:
|
for xmp_field in xmp_fields:
|
||||||
data_set[xmp_field] = xmp.get_property(xmp_fields[xmp_field], xmp_field)
|
# need to check if propert exist or it will the exempi routine will fail
|
||||||
|
if xmp.does_property_exist(xmp_fields[xmp_field], xmp_field):
|
||||||
|
data_set[xmp_field] = xmp.get_property(xmp_fields[xmp_field], xmp_field)
|
||||||
|
else:
|
||||||
|
data_set[xmp_field] = ''
|
||||||
if args.debug:
|
if args.debug:
|
||||||
print("### => XMP: {}:{} => {}".format(xmp_fields[xmp_field], xmp_field, data_set[xmp_field]))
|
print("### => XMP: {}:{} => {}".format(xmp_fields[xmp_field], xmp_field, data_set[xmp_field]))
|
||||||
if args.read_only:
|
if args.read_only:
|
||||||
|
|||||||
Reference in New Issue
Block a user