Skip to content

Commit

Permalink
fix ImportError when pyexiv2 is not installed (superdesk#2732)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek authored Oct 17, 2024
1 parent 35768b8 commit 63519fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superdesk/media/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from typing import BinaryIO, Dict, List, Literal, Mapping, TypedDict, Union

from pyexiv2 import convert_xmp_to_iptc
from superdesk.text_utils import decode
from PIL import Image, ExifTags
from PIL import IptcImagePlugin
Expand Down Expand Up @@ -244,6 +243,8 @@ def write_metadata(input: bytes, metadata: PhotoMetadata) -> bytes:
@param file_stream: stream
@param metadata: dict
"""
from pyexiv2 import convert_xmp_to_iptc

xmp = {
"Xmp.dc.description": metadata.get("Description"),
"Xmp.photoshop.CaptionWriter": metadata.get("DescriptionWriter"),
Expand Down

0 comments on commit 63519fc

Please sign in to comment.