mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 11:09:26 +00:00
KeyError
This commit is contained in:
@@ -192,6 +192,8 @@ def get_image_info(item: str, folder: str) -> dict[str, Any]:
|
|||||||
xmp = xmpdata
|
xmp = xmpdata
|
||||||
except TypeError:
|
except TypeError:
|
||||||
...
|
...
|
||||||
|
except KeyError:
|
||||||
|
...
|
||||||
try:
|
try:
|
||||||
tags = xmpdata["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
tags = xmpdata["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
||||||
if isinstance(tags, str):
|
if isinstance(tags, str):
|
||||||
@@ -199,6 +201,8 @@ def get_image_info(item: str, folder: str) -> dict[str, Any]:
|
|||||||
xmp = xmpdata
|
xmp = xmpdata
|
||||||
except TypeError:
|
except TypeError:
|
||||||
...
|
...
|
||||||
|
except KeyError:
|
||||||
|
...
|
||||||
if None in tags:
|
if None in tags:
|
||||||
tags.remove(None)
|
tags.remove(None)
|
||||||
return {"width": width, "height": height, "tags": tags, "exifdata": exifdata, "xmp": xmp}
|
return {"width": width, "height": height, "tags": tags, "exifdata": exifdata, "xmp": xmp}
|
||||||
@@ -223,16 +227,18 @@ def get_tags(sidecarfile: str) -> list[str]:
|
|||||||
tags = xmpdata["xmpmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
tags = xmpdata["xmpmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
||||||
if isinstance(tags, str):
|
if isinstance(tags, str):
|
||||||
tags = [tags]
|
tags = [tags]
|
||||||
xmp = xmpdata
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
...
|
...
|
||||||
|
except KeyError:
|
||||||
|
...
|
||||||
try:
|
try:
|
||||||
tags = xmpdata["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
tags = xmpdata["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
||||||
if isinstance(tags, str):
|
if isinstance(tags, str):
|
||||||
tags = [tags]
|
tags = [tags]
|
||||||
xmp = xmpdata
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
...
|
...
|
||||||
|
except KeyError:
|
||||||
|
...
|
||||||
if None in tags:
|
if None in tags:
|
||||||
tags.remove(None)
|
tags.remove(None)
|
||||||
return tags
|
return tags
|
||||||
|
|||||||
Reference in New Issue
Block a user