Do some basic XML validation before running the xmpsdk library to avoid bugs in xmpsdk.
This commit is contained in:
Kevin Backhouse
2021-08-21 12:42:24 +01:00
parent c9f253f0e5
commit b35cc5ffa6
11 changed files with 183 additions and 35 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ Warning: Directory Image, entry 0x0111: Strip 9 is outside of the data area; ign
Error: Offset of directory Image, entry 0x0132 is out of bounds: Offset = 0x30003030; truncating the entry
Error: Directory Image, entry 0x8649 has invalid size 4294967295*1; skipping entry.
Error: Directory Image, entry 0x8769 Sub-IFD pointer 0 is out of bounds; ignoring it.
Error: XMP Toolkit error 201: XML parsing failure
Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
"""
]
+1 -1
View File
@@ -42,7 +42,7 @@ Exif comment :
Warning: Directory Image, entry 0x0111: Strip 17 is outside of the data area; ignored.
Error: Directory Photo with 8224 entries considered invalid; not read.
Warning: Removing 913 characters from the beginning of the XMP packet
Error: XMP Toolkit error 201: XML parsing failure
Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
"""
]
@@ -11,7 +11,7 @@ class coverage_xmpsidecar_isXmpType(metaclass=CaseMeta):
filename = path("$data_path/coverage_xmpsidecar_isXmpType.xmp")
commands = ["$exiv2 $filename"]
stderr = ["""Error: XMP Toolkit error 201: XML parsing failure
stderr = ["""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
$filename: No Exif data found in the file
"""]
+3 -4
View File
@@ -14,12 +14,11 @@ class InvalidDateXMP(metaclass=CaseMeta):
commands = ["$exiv2 -Ph $filename"]
stderr = [
"""Warning: Failed to convert Xmp.xmp.CreateDate to Exif.Photo.DateTimeDigitized (Day is out of range)
Exiv2 exception in print action for file $filename:
Xmpdatum::copy: Not supported
"""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
"""
]
retval = [1]
retval = [0]
def compare_stdout(self, i, command, got_stdout, expected_stdout):
""" We don't care about the stdout, just don't crash """
+3 -23
View File
@@ -15,27 +15,7 @@ class EmptyStringXmpTextValueRead(metaclass=CaseMeta):
File size : 1088 Bytes
MIME type : application/rdf+xml
Image size : 0 x 0
Thumbnail : None
Camera make :
Camera model :
Image timestamp :
File number :
Exposure time :
Aperture :
Exposure bias :
Flash :
Flash bias :
Focal length :
Subject distance:
ISO speed :
Exposure mode :
Metering mode :
Macro mode :
Image quality :
White balance :
Copyright :
Exif comment :
"""]
stderr = [""]
retval = [0]
stderr = ["""$filename: No Exif data found in the file
"""]
retval = [253]
+1 -1
View File
@@ -29,7 +29,7 @@ class PngReadRawProfile(metaclass=system_tests.CaseMeta):
stderr.append("""$exiv2_exception_message """ + filenames[5] + """:
$kerInputDataReadFailed
""")
stderr.append("""Error: XMP Toolkit error 201: XML parsing failure
stderr.append("""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
""" + stderr_exception(filenames[6]))
stderr.append("""Warning: Failed to decode Exif metadata.
+2 -2
View File
@@ -24,8 +24,8 @@ MIME type : application/rdf+xml
Image size : 0 x 0
"""
]
stderr = [
"""Warning: Failed to convert Xmp.xmp.CreateDate to Exif.Photo.DateTimeDigitized (Day is out of range)
stderr = ["""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
$filename: No Exif data found in the file
"""]
retval = [253]
@@ -15,7 +15,7 @@ class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
commands = ["$exiv2 in $filename1"]
stdout = [""]
stderr = [
"""Error: XMP Toolkit error 201: XML parsing failure
"""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
"""]
retval = [0]
@@ -16,6 +16,8 @@ File size : 276 Bytes
MIME type : application/rdf+xml
Image size : 0 x 0
"""]
stderr = ["""$filename: No Exif data found in the file
stderr = ["""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
$filename: No Exif data found in the file
"""]
retval = [253]