From 0462d2bf0ffef0187a5fa371eb76819ccfc5414e Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 19 Aug 2016 10:10:06 +0000 Subject: [PATCH] #1199. Adding tests for -iC. Fixed bug in -pC. Test code added for -ix and -ie, however I don't think the options are working correctly. --- src/webpimage.cpp | 2 +- test/bugfixes-test.sh | 40 ++++++++++++++++++++++++++++++++---- test/data/bugfixes-test.out | Bin 1929922 -> 1930752 bytes 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/webpimage.cpp b/src/webpimage.cpp index 7932c4c0..3fefb240 100644 --- a/src/webpimage.cpp +++ b/src/webpimage.cpp @@ -460,7 +460,7 @@ namespace Exiv2 { } bool bPrintPayload = (equalsWebPTag(chunkId, "XMP ") && option==kpsXMP) - || (equalsWebPTag(chunkId, "ICC ") && option==kpsIccProfile) + || (equalsWebPTag(chunkId, "ICCP") && option==kpsIccProfile) ; if ( bPrintPayload ) { out.write((const char*) payload.pData_,payload.size_); diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index 266c8e3d..4ff3fa9d 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -548,21 +548,53 @@ source ./functions.source runTest exiv2 -pa --grep fuji/i $filename done - num=1199 + num=1199 # WebPImage printf "$num " >&3 filename=exiv2-bug$num.webp # http://dev.exiv2.org/attachments/download/1033/Stonehenge-with-icc.webp + icc_name=exiv2-bug$num.icc + exv_name=exiv2-bug$num.exv copyTestFile $filename runTest exiv2 -pS $filename runTest exiv2 -pR $filename runTest exiv2 -pX $filename | xmllint --pretty 2 - # test deleting metadata - for arg in -dC -de -dx -dCe -dCx -dCxe; do + for option in -dC -de -dx -dCe -dCx -dCxe; do copyTestFile $filename runTest exiv2 -pS $filename - runTest exiv2 $arg $filename + runTest exiv2 $option $filename runTest exiv2 -pS $filename done - # TODO: inserting metadata + # test print/insert metadata + if [ 1 == 1 ]; then + # ICC Profile + copyTestFile $filename + copyTestFile Reagan.tiff + exiv2 -pS $filename + exiv2 -pC Reagan.tiff > $icc_name + exiv2 -iC $filename + exiv2 -pS $filename + fi + + if [ 1 == 0 ]; then + # XMP + copyTestFile $filename + copyTestFile Reagan.tiff + exiv2 -pS $filename + exiv2 --force -ex Reagan.tiff + mv Reagan.exv $exv_name + exiv2 -ix $filename + exiv2 -pS $filename + fi + + if [ 1 == 0 ]; then + # EXIF + copyTestFile exiv2-bug937.jpg $filename + exiv2 --force -ea $filename + copyTestFile $filename + exiv2 -pS $filename + exiv2 -ie $filename + exiv2 -pS $filename + fi num=1202 printf "$num " >&3 diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index ad1e2a6128e64cd0014b64c6895167cd25ab5379..3bbe853adf7e893354177f1b9cb8e0fe0a023274 100644 GIT binary patch delta 157 zcmX@~w6x((X+sNR3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3ttO=i$IHDi%^Sji%5%T zi&%?zi$sfLi&Tqri_8|;!ouyJ^JM=rvRWD#8X8Rx)ROg-GBz|ZRj5&b0Am9nQ%_IN z!zVK@f4XCetRaiBp@qrxi`lYj)A_Y!#aK*@3=F0hZc`Oc%_NRoPxxC>zKK E087v=5C8xG delta 82 zcmV~$xe-7>06@`M_kG`N6Jky647uQUAkc^zxn5)<4e;LjEZ4oP2sCsIOe}01Ts(XN hLLy=kQZjN1N-Am^S~_}$Ln^huvz)eJEY5G1Lj0!)8_NIy