mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 11:09:26 +00:00
i am an idiot
This commit is contained in:
@@ -102,7 +102,7 @@ def get_image_info(item: str, folder: str) -> dict[str, Any]:
|
|||||||
logger.info("extracting image information", extra={"file": file})
|
logger.info("extracting image information", extra={"file": file})
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
exif = img.getexif()
|
exif = img.getexif()
|
||||||
xmp = img.getxmp()
|
xmpdata = img.getxmp()
|
||||||
|
|
||||||
except UnidentifiedImageError:
|
except UnidentifiedImageError:
|
||||||
logger.error("cannot identify image file", extra={"file": file})
|
logger.error("cannot identify image file", extra={"file": file})
|
||||||
@@ -147,13 +147,15 @@ def get_image_info(item: str, folder: str) -> dict[str, Any]:
|
|||||||
exifdata = None
|
exifdata = None
|
||||||
tags = []
|
tags = []
|
||||||
xmp = None
|
xmp = None
|
||||||
if xmp:
|
if xmpdata:
|
||||||
if xmp.get("xmpmeta", False):
|
if xmpdata.get("xmpmeta", False):
|
||||||
if xmp["xmpmeta"]["RDF"]["Description"].get("subject", False):
|
if xmpdata["xmpmeta"]["RDF"]["Description"].get("subject", False):
|
||||||
tags = xmp["xmpmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
tags = xmpdata["xmpmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
||||||
if xmp.get("xapmeta", False):
|
xmp = xmpdata
|
||||||
if xmp["xapmeta"]["RDF"]["Description"].get("subject", False):
|
if xmpdata.get("xapmeta", False):
|
||||||
tags = xmp["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
if xmpdata["xapmeta"]["RDF"]["Description"].get("subject", False):
|
||||||
|
tags = xmpdata["xapmeta"]["RDF"]["Description"]["subject"]["Bag"]["li"]
|
||||||
|
xmp = xmpdata
|
||||||
return {"width": width, "height": height, "tags": tags, "exifdata": exifdata, "xmp": xmp}
|
return {"width": width, "height": height, "tags": tags, "exifdata": exifdata, "xmp": xmp}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user