[testsuite] Port redmine issues 498-825

v0.27.3
Dan Čermák 7 years ago
parent 2356984274
commit f55cdce761

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class EasyaccessTest(metaclass=system_tests.CaseMeta):
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -v -M\"set Exif.Image.Make Samsung\" $filename",
"$easyaccess_test $filename"
]
stdout = [
"""File 1/1: $filename
Set Exif.Image.Make "Samsung" (Ascii)
""",
"""Orientation ( ) :
ISO speed ( ) :
Flash bias ( ) :
Exposure mode ( ) :
Scene mode ( ) :
Macro mode ( ) :
Image quality ( ) :
White balance ( ) :
Lens name ( ) :
Saturation ( ) :
Sharpness ( ) :
Contrast ( ) :
Scene capture type ( ) :
Metering mode ( ) :
Camera make (Exif.Image.Make ) : Samsung
Camera model ( ) :
Exposure time ( ) :
FNumber ( ) :
Subject distance ( ) :
Camera serial number ( ) :
Focal length ( ) :
AF point ( ) :
"""
]
stderr = [""] * 2
retval = [0] * 2

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class ReadDataAfterTagDelete(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/498"
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -v -M\"set Exif.GPSInfo.GPSLatitude 0/1 1/1 2/1\" $filename",
"$exiv2 -u -v -pv $filename",
"$exiv2 -u -v -M\"del Exif.GPSInfo.GPSLatitude\" $filename",
"$exiv2 -u -v -pv $filename"
]
stdout = [
"""File 1/1: $filename
Set Exif.GPSInfo.GPSLatitude "0/1 1/1 2/1" (Rational)
""",
"""File 1/1: $filename
0x8825 Image GPSTag Long 1 26
0x0002 GPSInfo GPSLatitude Rational 3 0/1 1/1 2/1
""",
"""File 1/1: $filename
Del Exif.GPSInfo.GPSLatitude
""",
"""File 1/1: $filename
"""
]
stderr = [""] * 3 + ["""$filename: No Exif data found in the file
"""]
retval = [0] * 4

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
import system_tests
class IptcFieldParsingTooStrict(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/501"
filename = "$data_path/exiv2-bug501.jpg"
commands = ["$exiv2 -u -pi $filename"]
encodings = ['windows-1252']
stdout = ["""Iptc.Application2.RecordVersion Short 1 2
Iptc.Application2.Caption String 15 Porträtt Eva
Iptc.Application2.Writer String 10 Elsa Nordh
Iptc.Application2.Byline String 10 Elsa Nordh
Iptc.Application2.ObjectName String 7 Hundbus
Iptc.Application2.DateCreated Date 8 2006-10-31
Iptc.Application2.City String 8 Göteborg
Iptc.Application2.ProvinceState String 15 Västra Götaland
Iptc.Application2.CountryName String 6 Sweden
Iptc.Application2.Keywords String 3 Eva
Iptc.Application2.Keywords String 7 Gallery
Iptc.Application2.Keywords String 21 Framkalla jul06 mamma
Iptc.Application2.Copyright String 19 http://nordharna.se
Iptc.Application2.ExpirationTime String 2 SE
Iptc.Application2.SubLocation String 9 ¥lltorp
Iptc.Application2.0x00d1 String 9 teborg
Iptc.Application2.0x00d2 String 17 ¤stra taland
Iptc.Application2.0x00d3 String 6 416 81
Iptc.Application2.0x00d4 String 6 Sweden
Iptc.Application2.0x00d5 String 19 +46-(0)736-21 50 74
Iptc.Application2.0x00d6 String 17 foto@nordharna.se
Iptc.Application2.0x00d7 String 27 http://gallery.nordharna.se
Iptc.Application2.0x00e3 String 27 http://gallery.nordharna.se
Iptc.Application2.0x00f2 String 1 4
"""]
stderr = ["""Warning: Unsupported time format
"""]
retval = [0]

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-bug528.jpg")
class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/528"
filename = "$data_path/exiv2-bug528_copy.jpg"
commands = [
"$exiv2 -u -pt $filename",
"$exiv2 -u -v -M\"set Exif.Image.Software GI\" $filename"
]
stdout = ["""Exif.Image.ProcessingSoftware Ascii 20 digiKam-0.9.4-beta4
Exif.Image.ImageWidth Long 1 2888
Exif.Image.ImageLength Long 1 1700
Exif.Image.DocumentName Ascii 13 Chambord.jpg
Exif.Image.Make Ascii 6 Canon
Exif.Image.Model Ascii 14 Canon EOS 40D
Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 72
Exif.Image.YResolution Rational 1 72
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.Software Ascii 11 GIMP 2.4.5
Exif.Image.DateTime Ascii 20 2008:04:14 08:24:04
Exif.Image.YCbCrPositioning Short 1 Centered
Exif.Image.Rating SLong 1 3
Exif.Image.RatingPercent SLong 1 50
Exif.Image.ExifTag Long 1 318
Exif.Photo.ExposureTime Rational 1 1/250 s
Exif.Photo.FNumber Rational 1 F11
Exif.Photo.ExposureProgram Short 1 Auto
Exif.Photo.ISOSpeedRatings Short 1 400
Exif.Photo.ExifVersion Undefined 4 2.21
Exif.Photo.DateTimeOriginal Ascii 20 2008:04:01 13:40:03
Exif.Photo.DateTimeDigitized Ascii 20 2008:04:01 13:40:03
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.ShutterSpeedValue SRational 1 1/256 s
Exif.Photo.ApertureValue Rational 1 F11
Exif.Photo.ExposureBiasValue SRational 1 +1/3 EV
Exif.Photo.MeteringMode Short 1 Multi-segment
Exif.Photo.Flash Short 1 No, compulsory
Exif.Photo.FocalLength Rational 1 10.0 mm
Exif.Photo.MakerNote Undefined 18 0 1 2 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.MakerNote.Offset Long 1 796
Exif.MakerNote.ByteOrder Ascii 3 MM
Exif.Canon.0x0200 0x0300 0
Exif.Photo.UserComment Undefined 37 Chateaux de la Loire
Chambord
Exif.Photo.SubSecTime Ascii 3 81
Exif.Photo.SubSecTimeOriginal Ascii 3 81
Exif.Photo.SubSecTimeDigitized Ascii 3 81
Exif.Photo.FlashpixVersion Undefined 4 1.00
Exif.Photo.ColorSpace Short 1 sRGB
Exif.Photo.PixelXDimension Long 1 2888
Exif.Photo.PixelYDimension Long 1 1700
Exif.Photo.FocalPlaneXResolution Rational 1 4438.36
Exif.Photo.FocalPlaneYResolution Rational 1 4445.97
Exif.Photo.FocalPlaneResolutionUnit Short 1 inch
Exif.Photo.CustomRendered Short 1 Normal process
Exif.Photo.ExposureMode Short 1 Auto
Exif.Photo.WhiteBalance Short 1 Auto
Exif.Photo.SceneCaptureType Short 1 Standard
Exif.Photo.Contrast Short 1 Normal
Exif.Photo.Saturation Short 1 Normal
Exif.Image.GPSTag Long 1 867
Exif.GPSInfo.GPSVersionID Byte 4 2.0.0.0
Exif.GPSInfo.GPSLatitudeRef Ascii 2 North
Exif.GPSInfo.GPSLatitude Rational 3 47deg 36' 58.020"
Exif.GPSInfo.GPSLongitudeRef Ascii 2 East
Exif.GPSInfo.GPSLongitude Rational 3 1deg 31' 0.940"
Exif.GPSInfo.GPSAltitudeRef Byte 1 Above sea level
Exif.GPSInfo.GPSAltitude Rational 1 86 m
Exif.Thumbnail.Compression Short 1 JPEG (old-style)
Exif.Thumbnail.JPEGInterchangeFormat Long 1 1055
Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 4492
""",
"""File 1/1: $filename
Set Exif.Image.Software "GI" (Ascii)
"""
]
stderr = [
"""Warning: Directory Canon, entry 0x0200 has unknown Exif (TIFF) type 768; setting type size 1.
""",
"""Warning: Directory Canon, entry 0x0200 has unknown Exif (TIFF) type 768; setting type size 1.
Warning: Directory Canon, entry 0x0200 has unknown Exif (TIFF) type 768; setting type size 1.
"""
]
retval = [0] * 2
compare_stderr = system_tests.check_no_ASAN_UBSAN_errors

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
import system_tests
class PrettyPrintXmp(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/540"
filename = "$data_path/exiv2-bug540.jpg"
commands = ["$exiv2 -u -px $filename"]
stdout = ["""Xmp.dc.creator XmpSeq 1 Ian Britton
Xmp.dc.description LangAlt 1 lang="x-default" Communications
Xmp.dc.rights LangAlt 1 lang="x-default" ian Britton - FreeFoto.com
Xmp.dc.source XmpText 12 FreeFoto.com
Xmp.dc.subject XmpBag 1 Communications
Xmp.dc.title LangAlt 1 lang="x-default" Communications
Xmp.exif.ApertureValue XmpText 3 F16
Xmp.exif.BrightnessValue XmpText 8 0.260156
Xmp.exif.ColorSpace XmpText 1 sRGB
Xmp.exif.DateTimeOriginal XmpText 20 2002:07:13 15:58:28
Xmp.exif.ExifVersion XmpText 4 2.00
Xmp.exif.ExposureBiasValue XmpText 6 -13/20 EV
Xmp.exif.ExposureProgram XmpText 1 Shutter priority
Xmp.exif.FNumber XmpText 3 F0.6
Xmp.exif.FileSource XmpText 1 (0)
Xmp.exif.FlashpixVersion XmpText 4 1.00
Xmp.exif.FocalLength XmpText 3 0.0 mm
Xmp.exif.FocalPlaneResolutionUnit XmpText 1 inch
Xmp.exif.FocalPlaneXResolution XmpText 8 12.0508
Xmp.exif.FocalPlaneYResolution XmpText 8 12.0508
Xmp.exif.GPSLatitude XmpText 13 54,59.380000N
Xmp.exif.GPSLongitude XmpText 12 1,54.850000W
Xmp.exif.GPSMapDatum XmpText 5 WGS84
Xmp.exif.GPSTimeStamp XmpText 20 2002:07:13 14:58:24
Xmp.exif.GPSVersionID XmpText 7 2.0.0.0
Xmp.exif.ISOSpeedRatings XmpSeq 1 0
Xmp.exif.MeteringMode XmpText 1 Multi-segment
Xmp.exif.PixelXDimension XmpText 4 2400
Xmp.exif.PixelYDimension XmpText 4 1600
Xmp.exif.SceneType XmpText 1 (0)
Xmp.exif.SensingMethod XmpText 1 One-chip color area
Xmp.exif.ShutterSpeedValue XmpText 10 1/724 s
Xmp.pdf.Keywords XmpText 14 Communications
Xmp.photoshop.AuthorsPosition XmpText 12 Photographer
Xmp.photoshop.CaptionWriter XmpText 11 Ian Britton
Xmp.photoshop.Category XmpText 3 BUS
Xmp.photoshop.City XmpText 1
Xmp.photoshop.Country XmpText 14 Ubited Kingdom
Xmp.photoshop.Credit XmpText 11 Ian Britton
Xmp.photoshop.DateCreated XmpText 10 2002-06-20
Xmp.photoshop.Headline XmpText 14 Communications
Xmp.photoshop.State XmpText 1
Xmp.photoshop.SupplementalCategories XmpBag 1 Communications
Xmp.photoshop.Urgency XmpText 1 5
Xmp.tiff.Artist XmpText 11 Ian Britton
Xmp.tiff.BitsPerSample XmpSeq 1 8
Xmp.tiff.Compression XmpText 1 6
Xmp.tiff.Copyright LangAlt 1 lang="x-default" ian Britton - FreeFoto.com
Xmp.tiff.ImageDescription LangAlt 1 lang="x-default" Communications
Xmp.tiff.ImageLength XmpText 3 400
Xmp.tiff.ImageWidth XmpText 3 600
Xmp.tiff.Make XmpText 8 FUJIFILM
Xmp.tiff.Model XmpText 12 FinePixS1Pro
Xmp.tiff.Orientation XmpText 1 top, left
Xmp.tiff.ResolutionUnit XmpText 1 inch
Xmp.tiff.Software XmpText 19 Adobe Photoshop 7.0
Xmp.tiff.XResolution XmpText 5 300
Xmp.tiff.YCbCrPositioning XmpText 1 Co-sited
Xmp.tiff.YResolution XmpText 5 300
Xmp.xmp.CreateDate XmpText 20 2002-07-13T15:58:28Z
Xmp.xmp.ModifyDate XmpText 20 2002-07-19T13:28:10Z
Xmp.xmpBJ.JobRef XmpText 0 type="Bag"
Xmp.xmpBJ.JobRef[1] XmpText 0 type="Struct"
Xmp.xmpBJ.JobRef[1]/stJob:name XmpText 12 Photographer
Xmp.xmpMM.DocumentID XmpText 58 adobe:docid:photoshop:84d4dba8-9b11-11d6-895d-c4d063a70fb0
Xmp.xmpRights.Marked XmpText 4 True
Xmp.xmpRights.WebStatement XmpText 16 www.freefoto.com
"""]
stderr = [""]
retval = [0]

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class SettingExifImageDateTimeDateGivesValueTooLarge(
metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/554"
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -v -M\"set Exif.Image.DateTime Date 2007-05-27\" $filename",
"$exiv2 -u -pt $filename"
]
stdout = [
"""File 1/1: $filename
Set Exif.Image.DateTime "2007-05-27" (Date)
""",
"""Exif.Image.DateTime Undefined 8 50 48 48 55 48 53 50 55
"""
]
stderr = [
"""Error: 'Date' is not a valid Exif (TIFF) type; using type 'Undefined'.
""",
""
]
retval = [0] * 2

@ -0,0 +1,113 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class UnicodeEncodingOfExifUserCommentTag(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/662"
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Ascii An ascii comment\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Ascii A\\\\nnewline\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode A Unicode comment\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode \\\\u01c4\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode A\\\\u01c4C\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode With\\\\nNewline\" $filename",
"$exiv2 -u -PEnh $filename",
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode With\\\\tTab\" $filename",
"$exiv2 -u -PEnh $filename",
#Test invalid escape sequences
"$exiv2 -u -M\"set Exif.Photo.UserComment charset=Unicode \\\\ugggg\" $filename",
"$exiv2 -u -PEnh $filename",
]
stdout = [
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 41 53 43 49 49 00 00 00 41 6e 20 61 73 63 69 69 ASCII...An ascii
0010 20 63 6f 6d 6d 65 6e 74 comment
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 41 53 43 49 49 00 00 00 41 0a 6e 65 77 6c 69 6e ASCII...A.newlin
0010 65 e
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 41 00 20 00 55 00 6e 00 UNICODE.A. .U.n.
0010 69 00 63 00 6f 00 64 00 65 00 20 00 63 00 6f 00 i.c.o.d.e. .c.o.
0020 6d 00 6d 00 65 00 6e 00 74 00 m.m.e.n.t.
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 c4 01 UNICODE...
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 41 00 c4 01 43 00 UNICODE.A...C.
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 57 00 69 00 74 00 68 00 UNICODE.W.i.t.h.
0010 0a 00 4e 00 65 00 77 00 6c 00 69 00 6e 00 65 00 ..N.e.w.l.i.n.e.
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 57 00 69 00 74 00 68 00 UNICODE.W.i.t.h.
0010 09 00 54 00 61 00 62 00 ..T.a.b.
""",
"",
"""ExifTag
0000 1a 00 00 00 ....
UserComment
0000 55 4e 49 43 4f 44 45 00 5c 00 75 00 67 00 67 00 UNICODE.\.u.g.g.
0010 67 00 67 00 g.g.
"""
]
stderr = [""] * 16
retval = [0] * 16

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class OptimizeBinaryArrayElements(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/666"
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -v -M'set Exif.Image.Make NIKON' "
"-M'set Exif.Image.Model D90' "
"-M'set Exif.Nikon3.ShutterCount 100' "
"-M'set Exif.Nikon3.SerialNumber 123' "
"-M'set Exif.NikonSi02xx.Version 48 50 51 52' "
"-M'set Exif.NikonSi02xx.ShutterCount 100' $filename",
"$exiv2 -u -pa -u -b $filename"
]
stdout = [
"""File 1/1: $filename
Set Exif.Image.Make "NIKON" (Ascii)
Set Exif.Image.Model "D90" (Ascii)
Set Exif.Nikon3.ShutterCount "100" (Long)
Set Exif.Nikon3.SerialNumber "123" (Ascii)
Set Exif.NikonSi02xx.Version "48 50 51 52" (Byte)
Set Exif.NikonSi02xx.ShutterCount "100" (Long)
""",
"""Exif.Image.Make Ascii 6 NIKON
Exif.Image.Model Ascii 4 D90
Exif.Image.ExifTag Long 1 56
Exif.Photo.MakerNote Undefined 694 78 105 107 111 110 0 2 16 0 0 73 73 42 0 8 0 0 0 3 0 167 0 4 0 1 0 0 0 100 0 0 0 29 0 2 0 4 0 0 0 49 50 51 0 145 0 7 0 122 2 0 0 50 0 0 0 0 0 0 0 48 50 51 52 21 164 34 143 235 54 112 153 177 184 174 147 103 42 220 125 13 140 250 87 163 222 8 33 41 32 6 219 159 82 244 133 5 116 210 31 91 134 160 169 161 136 94 35 215 122 12 141 253 92 170 231 19 46 56 49 25 240 182 107 15 162 36 149 245 68 130 175 203 214 208 185 145 88 14 179 71 202 60 157 237 44 90 119 131 126 104 65 9 192 102 251 127 242 84 165 229 20 50 63 59 38 0 201 129 40 190 67 183 26 108 173 221 252 10 7 243 206 152 81 249 144 22 139 239 66 132 181 213 228 226 207 171 118 48 217 113 248 110 211 39 106 156 189 205 204 186 151 99 30 200 97 233 96 198 27 95 146 180 197 197 180 146 95 27 198 96 233 97 200 30 99 151 186 204 205 189 156 106 39 211 110 248 113 217 48 118 171 207 226 228 213 181 132 66 239 139 22 144 249 81 152 206 243 7 10 252 221 173 108 26 183 67 190 40 129 201 0 38 59 63 50 20 229 165 84 242 127 251 102 192 9 65 104 126 131 119 90 44 237 157 60 202 71 179 14 88 145 185 208 214 203 175 130 68 245 149 36 162 15 107 182 240 25 49 56 46 19 231 170 92 253 141 12 122 215 35 94 136 161 169 160 134 91 31 210 116 5 133 244 82 159 219 6 32 41 33 8 222 163 87 250 140 13 125 220 42 103 147 174 184 177 153 112 54 235 143 34 164 21 117 196 2 47 75 86 80 57 17 216 142 51 199 74 188 29 109 172 218 247 3 254 232 193 137 64 230 123 255 114 212 37 101 148 178 191 187 166 128 73 1 168 62 195 55 154 236 45 93 124 138 135 115 78 24 209 121 16 150 11 111 194 4 53 85 100 98 79 43 246 176 89 241 120 238 83 167 234 28 61 77 76 58 23 227 158 72 225 105 224 70 155 223 18 52 69 69 52 18 223 155 70 224 105 225 72 158 227 23 58 76 77 61 28 234 167 83 238 120 241 89 176 246 43 79 98 100 85 53 4 194 111 11 150 16 121 209 24 78 115 135 138 124 93 45 236 154 55 195 62 168 1 73 128 166 187 191 178 148 101 37 212 114 255 123 230 64 137 193 232 254 3 247 218 172 109 29 188 74 199 51 142 216 17 57 80 86 75 47 2 196 117 21 164 34 143 235 54 112 153 177 184 174 147 103 42 220 125 13 140 250 87 163 222 8 33 41 32 6 219 159 82 244 133 5 116 210 31 91 134 160 169 161 136 94 35 215 122 12 141 253 92 170 231 19 46 56 49 25 240 182 107 15 162 36 149 245 68 130 175 203 214 208 185 145 88 14 179 71 202 60 157 237 44 90 119 131 126 104 65 9 192 102 251 127 242 84 165 229 20 50 63 59 38 0 201 129 40 190 67 183 26 108 173 221 252 10 7 243 170
Exif.MakerNote.Offset Long 1 74
Exif.MakerNote.ByteOrder Ascii 3 II
Exif.Nikon3.ShutterCount Long 1 100
Exif.Nikon3.SerialNumber Ascii 4 123
Exif.NikonSi02xx.Version Undefined 4 2.34
Exif.NikonSi02xx.0x0004 Byte 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.ShutterCount1 Long 1 0
Exif.NikonSi02xx.DeletedImageCount Long 1 0
Exif.NikonSi02xx.0x0072 Byte 3 0 0 0
Exif.NikonSi02xx.VibrationReduction Byte 1 Off
Exif.NikonSi02xx.0x0076 Byte 12 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.VibrationReduction1 Byte 1 Off
Exif.NikonSi02xx.0x0083 Byte 212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.ShutterCount2 Undefined 2 0 0
Exif.NikonSi02xx.0x0159 Byte 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.VibrationReduction2 Byte 1 n/a
Exif.NikonSi02xx.0x01af Byte 167 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.ISO Byte 1 3
Exif.NikonSi02xx.0x0257 Byte 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.NikonSi02xx.ShutterCount Long 1 100
"""
]
stderr = [""] * 2
retval = [0] * 2

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import os
import shutil
import system_tests
class PercentABrokenInRename(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/683"
original_file = "$data_path/exiv2-nikon-d70.jpg"
filename = "$data_path/exiv2-nikon-d70_copy.jpg"
new_file = "$data_path/2004-03-30-Tue-090.jpg"
commands = ["$exiv2 -u -f -r %Y-%m-%d-%a-%j $filename"]
stdout = [""]
stderr = [""]
retval = [0]
def setUp(self):
shutil.copyfile(self.original_file, self.filename)
def tearDown(self):
self.assertTrue(os.path.exists(self.new_file))
os.remove(self.new_file)

@ -0,0 +1,212 @@
# -*- coding: utf-8 -*-
import system_tests
URL = "http://dev.exiv2.org/issues/711"
COMMANDS = [
"$exiv2 -u -v -M'set Exif.Image.ProcessingSoftware Initial values, read from the command line' "
"-M'set Exif.Image.DocumentName Float 0.12345' "
"-M'set Exif.Image.ImageDescription Double 0.987654321' $filename",
"$exiv2 -u -v -PEkyct $filename",
"$exiv2 -u -v -M'set Exif.Image.ProcessingSoftware Non-intrusive update' $filename",
"$exiv2 -u -v -PEkyct $filename",
"$exiv2 -u -v -M'set Exif.Image.ProcessingSoftware Intrusive update, writing the structure from scratch' $filename",
"$exiv2 -u -v -PEkyct $filename",
]
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class LittleEndianORFFilesFromE_PL1Corrupted(metaclass=system_tests.CaseMeta):
filename = "$data_path/exiv2-empty_copy.jpg"
commands = COMMANDS
stdout = [
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Initial values, read from the command line" (Ascii)
Set Exif.Image.DocumentName "0.12345" (Float)
Set Exif.Image.ImageDescription "0.987654321" (Double)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 43 Initial values, read from the command line
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
""",
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Non-intrusive update" (Ascii)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 21 Non-intrusive update
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
""",
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Intrusive update, writing the structure from scratch" (Ascii)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 53 Intrusive update, writing the structure from scratch
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
"""
]
stderr = [""] * 6
retval = [0] * 6
@system_tests.CopyFiles("$data_path/exiv2-kodak-dc210.jpg")
class BigEndianORFFilesFromE_PL1Corrupted(metaclass=system_tests.CaseMeta):
filename = "$data_path/exiv2-kodak-dc210_copy.jpg"
commands = COMMANDS
stdout = [
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Initial values, read from the command line" (Ascii)
Set Exif.Image.DocumentName "0.12345" (Float)
Set Exif.Image.ImageDescription "0.987654321" (Double)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 43 Initial values, read from the command line
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
Exif.Image.Make Ascii 22 Eastman Kodak Company
Exif.Image.Model Ascii 20 DC210 Zoom (V05.00)
Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 216
Exif.Image.YResolution Rational 1 216
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.YCbCrPositioning Short 1 Centered
Exif.Image.Copyright Ascii 0
Exif.Image.ExifTag Long 1 268
Exif.Photo.ExposureTime Rational 1 1/30 s
Exif.Photo.FNumber Rational 1 F4
Exif.Photo.ExifVersion Undefined 4 1.10
Exif.Photo.DateTimeOriginal Ascii 20 2000:10:26 16:46:51
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.CompressedBitsPerPixel Rational 1 (0/0)
Exif.Photo.ShutterSpeedValue SRational 1 1/32 s
Exif.Photo.ApertureValue Rational 1 F4
Exif.Photo.BrightnessValue SRational 1 1.5
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MaxApertureValue Rational 1 F4
Exif.Photo.SubjectDistance Rational 1 Unknown
Exif.Photo.MeteringMode Short 1 Center weighted average
Exif.Photo.LightSource Short 1 Unknown
Exif.Photo.Flash Short 1 Fired
Exif.Photo.FocalLength Rational 1 4.4 mm
Exif.Photo.MakerNote Undefined 72 1 4 3 0 2 1 255 255 0 1 55 142 14 93 109 246 1 0 0 251 0 4 255 32 0 0 40 0 0 0 12 53 68 67 80 48 49 48 49 49 46 74 80 71 0 4 0 0 0 1 228 224 0 1 0 0 0 1 145 128 0 1 194 64 0 1 0 0 0 1 222 16
Exif.Thumbnail.ImageWidth Short 1 96
Exif.Thumbnail.ImageLength Short 1 72
Exif.Thumbnail.BitsPerSample Short 3 8 8 8
Exif.Thumbnail.Compression Short 1 Uncompressed
Exif.Thumbnail.PhotometricInterpretation Short 1 RGB
Exif.Thumbnail.StripOffsets Short 1 822
Exif.Thumbnail.SamplesPerPixel Short 1 3
Exif.Thumbnail.RowsPerStrip Short 1 72
Exif.Thumbnail.StripByteCounts Short 1 20736
Exif.Thumbnail.XResolution Rational 1 72
Exif.Thumbnail.YResolution Rational 1 72
Exif.Thumbnail.ResolutionUnit Short 1 inch
""",
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Non-intrusive update" (Ascii)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 21 Non-intrusive update
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
Exif.Image.Make Ascii 22 Eastman Kodak Company
Exif.Image.Model Ascii 20 DC210 Zoom (V05.00)
Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 216
Exif.Image.YResolution Rational 1 216
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.YCbCrPositioning Short 1 Centered
Exif.Image.Copyright Ascii 0
Exif.Image.ExifTag Long 1 268
Exif.Photo.ExposureTime Rational 1 1/30 s
Exif.Photo.FNumber Rational 1 F4
Exif.Photo.ExifVersion Undefined 4 1.10
Exif.Photo.DateTimeOriginal Ascii 20 2000:10:26 16:46:51
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.CompressedBitsPerPixel Rational 1 (0/0)
Exif.Photo.ShutterSpeedValue SRational 1 1/32 s
Exif.Photo.ApertureValue Rational 1 F4
Exif.Photo.BrightnessValue SRational 1 1.5
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MaxApertureValue Rational 1 F4
Exif.Photo.SubjectDistance Rational 1 Unknown
Exif.Photo.MeteringMode Short 1 Center weighted average
Exif.Photo.LightSource Short 1 Unknown
Exif.Photo.Flash Short 1 Fired
Exif.Photo.FocalLength Rational 1 4.4 mm
Exif.Photo.MakerNote Undefined 72 1 4 3 0 2 1 255 255 0 1 55 142 14 93 109 246 1 0 0 251 0 4 255 32 0 0 40 0 0 0 12 53 68 67 80 48 49 48 49 49 46 74 80 71 0 4 0 0 0 1 228 224 0 1 0 0 0 1 145 128 0 1 194 64 0 1 0 0 0 1 222 16
Exif.Thumbnail.ImageWidth Short 1 96
Exif.Thumbnail.ImageLength Short 1 72
Exif.Thumbnail.BitsPerSample Short 3 8 8 8
Exif.Thumbnail.Compression Short 1 Uncompressed
Exif.Thumbnail.PhotometricInterpretation Short 1 RGB
Exif.Thumbnail.StripOffsets Short 1 822
Exif.Thumbnail.SamplesPerPixel Short 1 3
Exif.Thumbnail.RowsPerStrip Short 1 72
Exif.Thumbnail.StripByteCounts Short 1 20736
Exif.Thumbnail.XResolution Rational 1 72
Exif.Thumbnail.YResolution Rational 1 72
Exif.Thumbnail.ResolutionUnit Short 1 inch
""",
"""File 1/1: $filename
Set Exif.Image.ProcessingSoftware "Intrusive update, writing the structure from scratch" (Ascii)
""",
"""File 1/1: $filename
Exif.Image.ProcessingSoftware Ascii 53 Intrusive update, writing the structure from scratch
Exif.Image.DocumentName Float 1 0.123450003564358
Exif.Image.ImageDescription Double 1 0.987654321
Exif.Image.Make Ascii 22 Eastman Kodak Company
Exif.Image.Model Ascii 20 DC210 Zoom (V05.00)
Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 216
Exif.Image.YResolution Rational 1 216
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.YCbCrPositioning Short 1 Centered
Exif.Image.Copyright Ascii 0
Exif.Image.ExifTag Long 1 278
Exif.Photo.ExposureTime Rational 1 1/30 s
Exif.Photo.FNumber Rational 1 F4
Exif.Photo.ExifVersion Undefined 4 1.10
Exif.Photo.DateTimeOriginal Ascii 20 2000:10:26 16:46:51
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.CompressedBitsPerPixel Rational 1 (0/0)
Exif.Photo.ShutterSpeedValue SRational 1 1/32 s
Exif.Photo.ApertureValue Rational 1 F4
Exif.Photo.BrightnessValue SRational 1 1.5
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MaxApertureValue Rational 1 F4
Exif.Photo.SubjectDistance Rational 1 Unknown
Exif.Photo.MeteringMode Short 1 Center weighted average
Exif.Photo.LightSource Short 1 Unknown
Exif.Photo.Flash Short 1 Fired
Exif.Photo.FocalLength Rational 1 4.4 mm
Exif.Photo.MakerNote Undefined 72 1 4 3 0 2 1 255 255 0 1 55 142 14 93 109 246 1 0 0 251 0 4 255 32 0 0 40 0 0 0 12 53 68 67 80 48 49 48 49 49 46 74 80 71 0 4 0 0 0 1 228 224 0 1 0 0 0 1 145 128 0 1 194 64 0 1 0 0 0 1 222 16
Exif.Thumbnail.ImageWidth Short 1 96
Exif.Thumbnail.ImageLength Short 1 72
Exif.Thumbnail.BitsPerSample Short 3 8 8 8
Exif.Thumbnail.Compression Short 1 Uncompressed
Exif.Thumbnail.PhotometricInterpretation Short 1 RGB
Exif.Thumbnail.StripOffsets Short 1 832
Exif.Thumbnail.SamplesPerPixel Short 1 3
Exif.Thumbnail.RowsPerStrip Short 1 72
Exif.Thumbnail.StripByteCounts Short 1 20736
Exif.Thumbnail.XResolution Rational 1 72
Exif.Thumbnail.YResolution Rational 1 72
Exif.Thumbnail.ResolutionUnit Short 1 inch
"""
]
stderr = [""] * 6
retval = [0] * 6

@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.DeleteFiles("$xmpname")
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class AdobeXmpNamespace(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/751"
filename = "$data_path/exiv2-empty_copy.jpg"
xmpname = "$data_path/exiv2-empty_copy.xmp"
commands = [
"$exiv2 -v -M'reg imageapp orig/' -M 'set Xmp.imageapp.uuid abcd' $filename",
"$exiv2 -f -eX $filename",
"$cat $xmpname",
"$exiv2 -v -M'reg imageapp dest/' -M 'set Xmp.imageapp.uuid abcd' $filename",
"$exiv2 -f -eX $filename",
"$cat $xmpname",
]
stdout = [
"""File 1/1: $filename
Reg imageapp="orig/"
Set Xmp.imageapp.uuid "abcd" (XmpText)
""",
"",
"""<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:imageapp="orig/"
imageapp:uuid="abcd"/>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>""",
"""File 1/1: $filename
Reg imageapp="dest/"
Set Xmp.imageapp.uuid "abcd" (XmpText)
""",
"",
"""<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:imageapp="orig/"
imageapp:uuid="abcd"/>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>"""
]
stderr = [
"",
"",
"",
"""Warning: Updating namespace URI for imageapp from orig/ to dest/
""",
"""Warning: Updating namespace URI for imageapp from dest/ to orig/
""",
""
]
retval = [0] * 6

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class AssertionSvEqualsDFailedRegression(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/769"
filename = "$data_path/exiv2-empty_copy.jpg"
commands = [
"$exiv2 -u -v -M\"add Exif.Image.Make Canon\" -M\"add Exif.CanonCs.0x0001 Short 1\" -M\"add Exif.CanonCs.0x0000 Short 2\" $filename",
"$exiv2 -u -v -PEkyct $filename"
]
stdout = [
"""File 1/1: $filename
Add Exif.Image.Make "Canon" (Ascii)
Add Exif.CanonCs.0x0001 "1" (Short)
Add Exif.CanonCs.0x0000 "2" (Short)
""",
"""File 1/1: $filename
Exif.Image.Make Ascii 6 Canon
Exif.Image.ExifTag Long 1 44
Exif.Photo.MakerNote Undefined 18 1 0 1 0 3 0 2 0 0 0 4 0 1 0 0 0 0 0
Exif.MakerNote.Offset Long 1 62
Exif.MakerNote.ByteOrder Ascii 3 II
Exif.CanonCs.0x0000 Short 1 4
Exif.CanonCs.Macro Short 1 On
"""
]
stderr = [""] * 2
retval = [0] * 2

@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.CopyFiles("$data_path/exiv2-bug784.jpg")
class WritingXmpLrHierarchicalSubjectWritesWrongDatatype(
metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/784"
filename = "$data_path/exiv2-bug784_copy.jpg"
commands = [
"$exiv2 -px $filename",
"$exiv2 -M\"add Xmp.lr.hierarchicalSubject root|1st|2nd|3rd|4th|5th\" $filename",
"$exiv2 -px $filename",
]
stdout = [
"""Xmp.dc.format XmpText 10 image/jpeg
Xmp.dc.rights LangAlt 1 lang="x-default" Public Domain. Do whatever you like with this image
Xmp.dc.subject XmpBag 6 1st, 2nd, next1, next2, root, root0
Xmp.xmpMM.DocumentID XmpText 32 004D48F936062EF5085A81BF96D4C494
Xmp.xmpMM.OriginalDocumentID XmpText 32 004D48F936062EF5085A81BF96D4C494
Xmp.xmpMM.InstanceID XmpText 44 xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853
Xmp.xmpMM.History XmpText 0 type="Seq"
Xmp.xmpMM.History[1] XmpText 0 type="Struct"
Xmp.xmpMM.History[1]/stEvt:action XmpText 5 saved
Xmp.xmpMM.History[1]/stEvt:instanceID XmpText 44 xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853
Xmp.xmpMM.History[1]/stEvt:when XmpText 25 2015-03-24T20:35:55-05:00
Xmp.xmpMM.History[1]/stEvt:softwareAgent XmpText 39 Adobe Photoshop Lightroom 4.4 (Windows)
Xmp.xmpMM.History[1]/stEvt:changed XmpText 9 /metadata
Xmp.xmp.MetadataDate XmpText 25 2015-03-24T20:35:55-05:00
Xmp.crs.RawFileName XmpText 12 exiv2.lr.jpg
Xmp.lr.hierarchicalSubject XmpBag 2 root0|next1|next2, root|1st|2nd
""",
"",
"""Xmp.dc.format XmpText 10 image/jpeg
Xmp.dc.rights LangAlt 1 lang="x-default" Public Domain. Do whatever you like with this image
Xmp.dc.subject XmpBag 6 1st, 2nd, next1, next2, root, root0
Xmp.xmpMM.DocumentID XmpText 32 004D48F936062EF5085A81BF96D4C494
Xmp.xmpMM.OriginalDocumentID XmpText 32 004D48F936062EF5085A81BF96D4C494
Xmp.xmpMM.InstanceID XmpText 44 xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853
Xmp.xmpMM.History XmpText 0 type="Seq"
Xmp.xmpMM.History[1] XmpText 0 type="Struct"
Xmp.xmpMM.History[1]/stEvt:action XmpText 5 saved
Xmp.xmpMM.History[1]/stEvt:instanceID XmpText 44 xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853
Xmp.xmpMM.History[1]/stEvt:when XmpText 25 2015-03-24T20:35:55-05:00
Xmp.xmpMM.History[1]/stEvt:softwareAgent XmpText 39 Adobe Photoshop Lightroom 4.4 (Windows)
Xmp.xmpMM.History[1]/stEvt:changed XmpText 9 /metadata
Xmp.xmp.MetadataDate XmpText 25 2015-03-24T20:35:55-05:00
Xmp.crs.RawFileName XmpText 12 exiv2.lr.jpg
Xmp.lr.hierarchicalSubject XmpBag 1 root|1st|2nd|3rd|4th|5th
"""
]
stderr = [""] * 3
retval = [0] * 3

@ -0,0 +1,121 @@
# -*- coding: utf-8 -*-
import system_tests
@system_tests.DeleteFiles("$xmpfile")
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg")
class WrongXmpTypeForNestedXmpKeys(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/$num"
num = 799
cmdfile = "$data_path/bug$num.cmd"
filename_common = "$data_path/exiv2-empty_copy"
filename = "$filename_common.jpg"
xmpfile = "$filename_common.xmp"
commands = [
"$exiv2 -v -m $cmdfile $filename",
"$exiv2 -v -pa $filename",
"$exiv2 -f -eX $filename",
"$cat $xmpfile",
]
stdout = [
"""File 1/1: $filename
Set Xmp.MP.RegionInfo/MPRI:Regions "" (XmpBag)
Set Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:Rectangle "0.11, 0.22, 0.33, 0.44" (XmpText)
Set Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:PersonDisplayName "Baby Gnu" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:w "1600" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:h "800" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:unit "pixel" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList "" (XmpBag)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Name "Baby Gnu" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type "Face" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x "0.275312" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y "0.3775" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w "0.164375" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h "0.28125" (XmpText)
Set Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit "normalized" (XmpText)
""",
"""File 1/1: $filename
Xmp.MP.RegionInfo XmpText 0 type="Struct"
Xmp.MP.RegionInfo/MPRI:Regions XmpText 0 type="Bag"
Xmp.MP.RegionInfo/MPRI:Regions[1] XmpText 0 type="Struct"
Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:Rectangle XmpText 22 0.11, 0.22, 0.33, 0.44
Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:PersonDisplayName XmpText 8 Baby Gnu
Xmp.mwg-rs.Regions XmpText 0 type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions XmpText 0 type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:w XmpText 4 1600
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:h XmpText 3 800
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:unit XmpText 5 pixel
Xmp.mwg-rs.Regions/mwg-rs:RegionList XmpText 0 type="Bag"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1] XmpText 0 type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Name XmpText 8 Baby Gnu
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type XmpText 4 Face
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area XmpText 0 type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x XmpText 8 0.275312
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y XmpText 6 0.3775
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w XmpText 8 0.164375
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h XmpText 7 0.28125
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit XmpText 10 normalized
""",
"",
"""<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:MP="http://ns.microsoft.com/photo/1.2/"
xmlns:MPRI="http://ns.microsoft.com/photo/1.2/t/RegionInfo#"
xmlns:MPReg="http://ns.microsoft.com/photo/1.2/t/Region#"
xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
<MP:RegionInfo rdf:parseType="Resource">
<MPRI:Regions>
<rdf:Bag>
<rdf:li
MPReg:Rectangle="0.11, 0.22, 0.33, 0.44"
MPReg:PersonDisplayName="Baby Gnu"/>
</rdf:Bag>
</MPRI:Regions>
</MP:RegionInfo>
<mwg-rs:Regions rdf:parseType="Resource">
<mwg-rs:AppliedToDimensions
stDim:w="1600"
stDim:h="800"
stDim:unit="pixel"/>
<mwg-rs:RegionList>
<rdf:Bag>
<rdf:li>
<rdf:Description
mwg-rs:Name="Baby Gnu"
mwg-rs:Type="Face">
<mwg-rs:Area
stArea:x="0.275312"
stArea:y="0.3775"
stArea:w="0.164375"
stArea:h="0.28125"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
</rdf:Bag>
</mwg-rs:RegionList>
</mwg-rs:Regions>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>"""
]
stderr = [
"",
"""$filename: No Exif data found in the file
$filename: No IPTC data found in the file
""",
"",
""
]
retval = [0] * 4

@ -0,0 +1,127 @@
# -*- coding: utf-8 -*-
import itertools
import system_tests
TYPES = ["8BIM", "AgHg", "DCSR", "PHUT"]
FORMATS = ["jpg", "psd"]
def make_commands(filename):
return [
"$exiv2 -u -v -M'set Exif.Photo.UserComment Test' " + filename,
"$exiv2 -u -pt " + filename
]
def make_filename(irb_type, img_format):
return "$data_path/exiv2-bug800-" + irb_type + "_copy." + img_format
def make_stdout(irb_type, img_format):
first = """File 1/1: """ + make_filename(irb_type, img_format) + """
Set Exif.Photo.UserComment "Test" (Comment)
"""
if img_format == "jpg":
second = """Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 180
Exif.Image.YResolution Rational 1 180
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.Software Ascii 16 QuickTime 6.5.2
Exif.Image.DateTime Ascii 20 2005:03:27 19:46:52
Exif.Image.HostComputer Ascii 16 Mac OS X 10.3.8
Exif.Image.YCbCrPositioning Short 1 Centered
Exif.Image.ExifTag Long 1 190
Exif.Photo.ExposureTime Rational 1 1/200 s
Exif.Photo.FNumber Rational 1 F7.1
Exif.Photo.ExifVersion Undefined 4 2.20
Exif.Photo.DateTimeOriginal Ascii 20 2005:03:18 22:15:08
Exif.Photo.DateTimeDigitized Ascii 20 2005:03:18 22:15:08
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.CompressedBitsPerPixel Rational 1 5
Exif.Photo.ShutterSpeedValue SRational 1 1/202 s
Exif.Photo.ApertureValue Rational 1 F7.1
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MaxApertureValue Rational 1 F2.8
Exif.Photo.MeteringMode Short 1 Multi-segment
Exif.Photo.Flash Short 1 No, auto
Exif.Photo.FocalLength Rational 1 7.4 mm
Exif.Photo.MakerNote Undefined 590 (Binary value suppressed)
Exif.Photo.UserComment Undefined 12 Test
Exif.Photo.FlashpixVersion Undefined 4 1.00
Exif.Photo.PixelXDimension Short 1 2272
Exif.Photo.PixelYDimension Short 1 1704
Exif.Photo.FocalPlaneXResolution Rational 1 8114.29
Exif.Photo.FocalPlaneYResolution Rational 1 8114.29
Exif.Photo.FocalPlaneResolutionUnit Short 1 inch
Exif.Photo.SensingMethod Short 1 One-chip color area
Exif.Photo.FileSource Undefined 1 Digital still camera
Exif.Photo.CustomRendered Short 1 Normal process
Exif.Photo.ExposureMode Short 1 Auto
Exif.Photo.WhiteBalance Short 1 Auto
Exif.Photo.DigitalZoomRatio Rational 1 1.0
Exif.Photo.SceneCaptureType Short 1 Standard
"""
elif img_format == 'psd':
second = """Exif.Image.ImageWidth Short 1 150
Exif.Image.ImageLength Short 1 91
Exif.Image.BitsPerSample Short 3 8 8 8
Exif.Image.Orientation Short 1 top, left
Exif.Image.SamplesPerPixel Short 1 3
Exif.Image.XResolution Rational 1 72
Exif.Image.YResolution Rational 1 72
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.Software Ascii 30 Adobe Photoshop CS5 Macintosh
Exif.Image.DateTime Ascii 20 2011:06:27 21:41:02
Exif.Image.ExifTag Long 1 218
Exif.Photo.ExifVersion Undefined 4 2.21
Exif.Photo.UserComment Undefined 12 Test
Exif.Photo.ColorSpace Short 1 Uncalibrated
Exif.Photo.PixelXDimension Long 1 150
Exif.Photo.PixelYDimension Long 1 91
Exif.Thumbnail.Compression Short 1 JPEG (old-style)
Exif.Thumbnail.XResolution Rational 1 72
Exif.Thumbnail.YResolution Rational 1 72
Exif.Thumbnail.ResolutionUnit Short 1 inch
Exif.Thumbnail.JPEGInterchangeFormat Long 1 390
Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 0
"""
return [first, second]
FILES = [
make_filename(irb_type, img_format)
for irb_type, img_format in itertools.product(TYPES, FORMATS)
]
ORIGINAL_FILES = [
"$data_path/exiv2-bug800-" + irb_type + "." + img_format
for irb_type, img_format in itertools.product(TYPES, FORMATS)
]
@system_tests.CopyFiles(*ORIGINAL_FILES)
class MissingPhotoshopIrbTypes(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/800"
types = ["8BIM", "AgHg", "DCSR", "PHUT"]
formats = ["jpg", "psd"]
commands = list(
itertools.chain.from_iterable(
make_commands(fname) for fname in FILES
)
)
stdout = list(
itertools.chain.from_iterable(
make_stdout(irb_type, img_format)
for irb_type, img_format in itertools.product(TYPES, FORMATS)
)
)
stderr = [""] * 16
retval = [0] * 16

@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
import os
import shutil
import system_tests
class DoNotDestroyHardLinks(metaclass=system_tests.CaseMeta):
def setUp(self):
shutil.copy(self.orig_file, self.filename)
os.link(self.filename, self.link_1)
os.link(self.filename, self.link_2)
def tearDown(self):
for f in [self.filename, self.link_1, self.link_2]:
os.remove(f)
url = "http://dev.exiv2.org/issues/812"
num = 812
# original file, copy & hardlinks
orig_file = "$data_path/exiv2-bug884c.jpg"
filename = "$data_path/exiv2-bug$num.jpg"
link_1 = "$data_path/exiv2-bug$num-B.jpg"
link_2 = "$data_path/exiv2-bug$num-C.jpg"
# list of files passed to exiv2 since we can't use * in the command
file_list = "{!s} {!s} {!s}".format(filename, link_1, link_2)
commands = [
"$exiv2 -u -v -M\"set Exif.Photo.UserComment Test Bug $num\" $filename",
"$exiv2 -PE -g UserComment $file_list",
"$exiv2 -u -v -M\"set Exif.Photo.UserComment Test Bug $num modified\" $filename",
"$exiv2 -PE -g UserComment $file_list"
]
first_change = "Exif.Photo.UserComment Undefined 20 Test Bug 812"
second_change = "Exif.Photo.UserComment Undefined 29 Test Bug 812 modified"
stdout = [
"""File 1/1: $filename
Set Exif.Photo.UserComment "Test Bug 812" (Comment)
""",
"""$filename $first_change
$link_1 $first_change
$link_2 $first_change
""",
"""File 1/1: $filename
Set Exif.Photo.UserComment "Test Bug 812 modified" (Comment)
""",
"""$filename $second_change
$link_1 $second_change
$link_2 $second_change
"""
]
stderr = [""] * 4
retval = [0] * 4

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
import system_tests
class DetectionOfSigma55_200mmLens(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/816"
filenames = [
"$data_path/exiv2-bug816{!s}.exv".format(char)
for char in ["a", "b", "c", "d", "e"]
]
commands = [
"$exiv2 -pa --grep Lens " + filename for filename in filenames
]
stdout = [
"""Exif.Pentax.LensType Byte 2 Sigma 55-200mm F4-5.6 DC
Exif.Pentax.LensInfo Undefined 36 3 255 0 0 40 148 71 152 80 6 241 65 237 153 88 36 1 76 107 251 255 255 255 0 0 80 6 241 0 0 0 0 0 0 0 0
""",
"""Exif.PentaxDng.LensType Byte 3 Sigma 55-200mm F4-5.6 DC
Exif.PentaxDng.LensInfo Undefined 69 131 0 0 255 0 40 148 68 244 112 6 243 65 197 153 88 35 1 73 107 251 255 255 255 0 0 112 6 243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
""",
"""Exif.Pentax.LensType Byte 3 Sigma 55-200mm F4-5.6 DC
Exif.Pentax.LensInfo Undefined 69 131 0 0 255 0 40 148 68 244 112 6 243 65 197 153 88 35 1 73 107 251 255 255 255 0 0 112 6 243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
""",
"""Exif.Pentax.LensType Byte 3 Sigma 55-200mm F4-5.6 DC
Exif.Pentax.LensInfo Undefined 69 131 0 0 255 0 40 148 68 244 112 6 243 65 197 153 88 35 1 73 107 251 255 255 255 0 0 112 6 243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
""",
"""Exif.PentaxDng.LensType Byte 4 Sigma 55-200mm F4-5.6 DC
Exif.PentaxDng.LensInfo Undefined 128 0 131 128 0 0 255 1 184 0 0 0 0 0 0 0 0 40 148 71 78 128 70 244 65 89 136 88 61 1 64 107 251 255 255 255 0 0 128 70 244 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
"""
]
stderr = [""] * 5
retval = [0] * 5

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import itertools
import system_tests
class PanasonicManometerTag(metaclass=system_tests.CaseMeta):
url = "http://dev.exiv2.org/issues/825"
filenames = [
"$data_path/exiv2-bug825{!s}.exv".format(char)
for char in ["a", "b"]
]
commands = list(itertools.chain(
*([
"$exiv2 -pv --grep mano/i " + filename,
"$exiv2 -pa --grep mano/i " + filename
] for filename in filenames)
))
stdout = [
"""0x0086 Panasonic ManometerPressure Short 1 65535
""",
"""Exif.Panasonic.ManometerPressure Short 1 infinite
""",
"""0x0086 Panasonic ManometerPressure Short 1 1007
""",
"""Exif.Panasonic.ManometerPressure Short 1 1007 hPa
"""
]
stderr = [""] * 4
retval = [0] * 4

@ -4,9 +4,11 @@ timeout: 1
[ENV]
exiv2_path: EXIV2_PATH
binary_extension: EXIV2_EXT
cat: EXIV2_CAT
[ENV fallback]
exiv2_path: ../build/bin
cat: cat
[paths]
exiv2: ${ENV:exiv2_path}/exiv2${ENV:binary_extension}
@ -14,6 +16,7 @@ exiv2json: ${ENV:exiv2_path}/exiv2json${ENV:binary_extension}
data_path: ../test/data
tiff_test: ${ENV:exiv2_path}/tiff-test${ENV:binary_extension}
largeiptc_test: ${ENV:exiv2_path}/largeiptc-test${ENV:binary_extension}
easyaccess_test: ${ENV:exiv2_path}/easyaccess-test${ENV:binary_extension}
[variables]
kerFailedToReadImageData: Failed to read image data
@ -26,3 +29,4 @@ addition_overflow_message: Overflow in addition
exiv2_exception_message: Exiv2 exception in print action for file
exiv2_overflow_exception_message: std::overflow_error exception in print action for file
exception_in_extract: Exiv2 exception in extract action for file
cat: ${ENV:cat}

Loading…
Cancel
Save