From 70b0c1742193d89d7bd64aaa1348701a146841b5 Mon Sep 17 00:00:00 2001 From: derselbst Date: Sat, 2 Nov 2019 17:48:35 +0100 Subject: [PATCH 01/10] Fix a memory leak in CiffHeader::read() Memory for pPadding_ was allocated with new[] . --- src/crwimage_int.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crwimage_int.cpp b/src/crwimage_int.cpp index c0d95535..d75d8b75 100644 --- a/src/crwimage_int.cpp +++ b/src/crwimage_int.cpp @@ -212,7 +212,7 @@ namespace Exiv2 { throw Error(kerNotACrwImage); } - delete pPadding_; + delete[] pPadding_; pPadding_ = new byte[offset_ - 14]; padded_ = offset_ - 14; std::memcpy(pPadding_, pData + 14, padded_); From b8bf9cc4fd162491224262f4f54861365261d568 Mon Sep 17 00:00:00 2001 From: David-Tillmann Schaefer Date: Sat, 9 Nov 2019 00:16:55 +0100 Subject: [PATCH 02/10] changes comma in aperture to dot to match the other exif entries (cherry picked from commit 054bc9068b3c4e83be97e42d1a8c9829c2c83e1b) --- src/nikonmn_int.cpp | 2 +- tests/bugfixes/github/test_issue_743.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index 0d212fb8..71ff272e 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -2532,7 +2532,7 @@ fmountlens[] = { {0x00,0x58,0x64,0x64,0x20,0x20,0x00,0x00,0x00,0x00,0x00, "Soligor", "", "C/D Macro MC 90mm f/2.5"}, // // https://github.com/Exiv2/exiv2/issues/743 -{0xc9,0x48,0x37,0x5c,0x24,0x24,0x4b,0x4e,0x01,0x00,0x00, "Sigma", "", "24-70mm F2,8 DG OS HSM Art"}, +{0xc9,0x48,0x37,0x5c,0x24,0x24,0x4b,0x4e,0x01,0x00,0x00, "Sigma", "", "24-70mm F2.8 DG OS HSM Art"}, // // https://github.com/Exiv2/exiv2/issues/598 , https://github.com/Exiv2/exiv2/pull/891 {0xCF,0x47,0x5C,0x8E,0x31,0x3D,0xDF,0x0E,0x00,0x00,0x00, "Tamron", "A030", "SP 70-300mm F/4-5.6 Di VC USD"}, diff --git a/tests/bugfixes/github/test_issue_743.py b/tests/bugfixes/github/test_issue_743.py index bc45fabb..798ce0f0 100644 --- a/tests/bugfixes/github/test_issue_743.py +++ b/tests/bugfixes/github/test_issue_743.py @@ -13,7 +13,7 @@ class Issue743NikonSigmaArtLens(metaclass=CaseMeta): commands = ["$exiv2 -pa --grep lensid/i $filename"] stderr = [""] stdout = ["" - """Exif.NikonLd3.LensIDNumber Byte 1 Sigma 24-70mm F2,8 DG OS HSM Art + """Exif.NikonLd3.LensIDNumber Byte 1 Sigma 24-70mm F2.8 DG OS HSM Art """ ] retval = [0] From 0e3fc867b293308ece830bf9be24b3c6be90f202 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2019 14:33:56 +0100 Subject: [PATCH 03/10] [ci] Install diffutils in the Fedora container (#1052) diff got removed from the base image but it required for the tests to run (cherry picked from commit bae0a773516edc575967f35befab1b3a92fb6e4d) --- ci/install_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/install_dependencies.sh b/ci/install_dependencies.sh index e27816b9..969cd396 100755 --- a/ci/install_dependencies.sh +++ b/ci/install_dependencies.sh @@ -24,7 +24,7 @@ distro_id=$(grep '^ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g') case "$distro_id" in 'fedora') - dnf -y --refresh install gcc-c++ clang cmake make ccache expat-devel zlib-devel libssh-devel libcurl-devel gtest-devel which dos2unix glibc-langpack-en + dnf -y --refresh install gcc-c++ clang cmake make ccache expat-devel zlib-devel libssh-devel libcurl-devel gtest-devel which dos2unix glibc-langpack-en diffutils ;; 'debian') From 0890d66a6e31350c3e181816ee9c7bb561f0900d Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Thu, 14 Nov 2019 15:06:38 +0100 Subject: [PATCH 04/10] EXIV2_ENABLE_SSH: Fix compatibility with >=libssh-0.9.2 0.9.1 remains broken regardless and is beyond fixing in this place. Build-tested with both libssh 0.9.0 and 0.9.2. Solution copied from KDE's kio-extras commit 24506c2af8d1904a99538543804306c6c2b81ca2 --- cmake/findDependencies.cmake | 13 +++++++++++-- src/CMakeLists.txt | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index a458a0c9..ec3a43f5 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -26,8 +26,17 @@ if( EXIV2_ENABLE_WEBREADY ) if( EXIV2_ENABLE_SSH ) find_package(libssh CONFIG REQUIRED) - endif( ) -endif( ) + # Define an imported target to have compatibility with <=libssh-0.9.0 + # libssh-0.9.1 is broken regardless. + if(NOT TARGET ssh) + add_library(ssh SHARED IMPORTED) + set_target_properties(ssh PROPERTIES + IMPORTED_LOCATION "${LIBSSH_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBSSH_INCLUDE_DIR}" + ) + endif() + endif() +endif() if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP) message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 27f8dbb1..bdd83fa0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,8 +173,7 @@ target_include_directories(exiv2lib_int PUBLIC if (EXIV2_ENABLE_WEBREADY) if( EXIV2_ENABLE_SSH ) - target_include_directories(exiv2lib SYSTEM PUBLIC ${LIBSSH_INCLUDE_DIR}) - target_link_libraries(exiv2lib PUBLIC ${LIBSSH_LIBRARIES}) + target_link_libraries(exiv2lib PUBLIC ssh) endif() if( EXIV2_ENABLE_CURL ) From 5360d82c4a64df8d6af21aa212ebe270e13eceb3 Mon Sep 17 00:00:00 2001 From: Fredrik Strandin Date: Fri, 27 Dec 2019 17:42:35 +0100 Subject: [PATCH 05/10] Add ID for Tokina atx-i 11-16mm F2.8 CF (Nikon) Fixes #1078 (cherry picked from commit 2870a1648e86b777afa0ae1540ea4791482d1354) --- src/nikonmn_int.cpp | 2 ++ test/data/Tokina_atx-i_11-16mm_F2.8_CF.exv | Bin 0 -> 19144 bytes tests/bugfixes/github/test_issue_1078.py | 15 +++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 test/data/Tokina_atx-i_11-16mm_F2.8_CF.exv create mode 100644 tests/bugfixes/github/test_issue_1078.py diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index 71ff272e..98bf9224 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -2538,6 +2538,8 @@ fmountlens[] = { {0xCF,0x47,0x5C,0x8E,0x31,0x3D,0xDF,0x0E,0x00,0x00,0x00, "Tamron", "A030", "SP 70-300mm F/4-5.6 Di VC USD"}, // {0xf4,0x4c,0x7c,0x7c,0x2c,0x2c,0x4b,0x02,0x00,0x00,0x00, "Sigma", "", "APO MACRO 180mm F3.5 EX DG"}, +// https://github.com/Exiv2/exiv2/issues/1078 +{0x80,0x48,0x1C,0x29,0x24,0x24,0x7A,0x06,0x00,0x00,0x00, "Tokina", "", "atx-i 11-16mm F2.8 CF"}, // {0,0,0,0,0,0,0,0,0,0,0, NULL, NULL, NULL} }; diff --git a/test/data/Tokina_atx-i_11-16mm_F2.8_CF.exv b/test/data/Tokina_atx-i_11-16mm_F2.8_CF.exv new file mode 100644 index 0000000000000000000000000000000000000000..8940e14da184d4f6b54131a61b9bc144ccea48c5 GIT binary patch literal 19144 zcmeHP2|SeB`+sK`%aAN%DceM4D2$=ak_J<0!5~S=5+Z97DkN)EDk&|J&?<$r(SnrH zs*{^=c^Xb>f&fN<5}iW{ByM>Lup*9c0;b_Q zM8JA*FB!^uI2nK`P(Fgw2=E9fd*GBI^6EtTTVsg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ests/bugfixes/github/test_issue_1046.py | 64 +++++++++++++++++++++++ tests/bugfixes/github/test_issue_987.py | 28 ---------- 3 files changed, 64 insertions(+), 28 deletions(-) create mode 100644 test/data/IMG_0246.exv create mode 100644 tests/bugfixes/github/test_issue_1046.py delete mode 100644 tests/bugfixes/github/test_issue_987.py diff --git a/test/data/IMG_0246.exv b/test/data/IMG_0246.exv new file mode 100644 index 0000000000000000000000000000000000000000..63d34c738c0ee3ab6194911e13b9e8a480ac68d5 GIT binary patch literal 15297 zcmeHOcR&=)lAmSCB00x(LCI+e5=D_HNy%AB;*xU|QACmmf`Cd;5D+CP83Ywfhy*1_ zPD%z5kRB%CN9wBg&@?wU!ap#F0L-SpD1->13i?elmrSY z1(sm1_BlobBO)V$0lz3w5g9RY8BtN_Fq9m!>vJJ+B5el-{4kv)tLFm#g$ zg1HDrOayszcPuY}KK>qV0~isvtAhaJ!;9OsKMu>|NpT*12N*AYSH1%G-IH$vOt2>> zL_!cz{H_lK;Cdu`7>+yXo(?(Cxfo9bjnhLAJ-}fA6N4ddG66T^@gN|A#6=(|?iU>Y z3x?A7#v&>rf=K^!9`W`t3QQDo4>M8#-_m#Ig%!*T`GZ~m@d2jT!(;$cKKOG^8GgY~ zCJ}Dzuuq7rT^#@+yk9W#7mS~^Yo8X_B>Y7#l7)w}1NVgsJj15}p#YHr`m0&~D;drY zp#K373XtO-2Miat{dxoq1Wf{E4sazTgaNHL!So}+54;MNzz06SXn;2XCWP=H&;dFQ zri=(+Ffoumz{Efc_SEMzHFOZ*DPYk7$SL>a5JZPhvuBf>4uTkAZSYGEFcXl&ePLqV z!vI2T0K=<+9$bWd-wpyoZ~(b7kV^tN8sJX=*8SFd4P`s1YgSsU?~s@ z_0)U{M){Vgs#5)py2z@CC# zIsgcc797b*K>2%hc+9XY0SuT6aCqEs9i~c9f$x>D42~Qu16u=n4*+Zno*`J~M6|mC zVLbqGvRX0-5&#&s56=v&_YKJ80EhKR_GCN&cM=e*lMNu-~xk6Og3? z4$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O3qKl&)Ln{&dUnr=j`O-DdQ)P#u=9Z7#0hoQ8*PZM|rfd)@js9SMb-@;zHs=B7(U8 zcR>Ri9=7LYbd^;0EP$Fkde2o~Utb|#F(FqEdtp&&X=z~*j4%cx2s8ve{aw7Q`~+P* zIrl9n*?HP{VBNgnKkJ4qT3Ne#d2^>-a}cKgHZUq%2{bd%Aw^1`~<%cDim!oV}( zJ=b9P$4HO;`~L>>yY+Vjen;SU1b#>0cLaV%;QwR<{(M)ma{(_%zTi!0r{`Y)orDnU literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_1046.py b/tests/bugfixes/github/test_issue_1046.py new file mode 100644 index 00000000..3f141bf5 --- /dev/null +++ b/tests/bugfixes/github/test_issue_1046.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +from system_tests import CaseMeta, CopyFiles, path +@CopyFiles("$data_path/IMG_0246.exv") + +class test_issue_1046Test(metaclass=CaseMeta): + + filename = path("$data_path/IMG_0246_copy.exv") + commands = ["$exiv2 -pt -g GPSInfo -g UserCom $filename" + ,"$exiv2 -pv -g GPSInfo -g UserCom $filename" + ,"$exiv2 -M'set Exif.Photo.UserComment charset=Ascii how now brown cow' $filename" + ,"$exiv2 -pt -g UserComment $filename" + ,"$exiv2 -pv -g UserComment $filename" + ,"$exiv2 -M'set Exif.Photo.UserComment charset=Unicode \u0041\u0042' $filename" + ,"$exiv2 -pt -g UserComment $filename" + ,"$exiv2 -pv -g UserComment $filename" + ,"$exiv2 -M'set Exif.Photo.UserComment hello world' $filename" + ,"$exiv2 -pt -g UserComment $filename" + ,"$exiv2 -pv -g UserComment $filename" + ,"$exiv2 -M'set Exif.GPSInfo.GPSProcessingMethod charset=Unicode \u0052\u006f\u0062\u0069\u006e' $filename" + ,"$exiv2 -M'set Exif.GPSInfo.GPSAreaInformation charset=Ascii area information' $filename" + ,"$exiv2 -pt -g GPSPro -g GPSArea $filename" + ,"$exiv2 -pv -g GPSPro -g GPSArea $filename" + ] + stdout = ["""Exif.Photo.UserComment Undefined 12 AB +Exif.GPSInfo.GPSVersionID Byte 4 2.2.0.0 +Exif.GPSInfo.GPSLatitudeRef Ascii 2 North +Exif.GPSInfo.GPSLatitude Rational 3 51deg 23' 13" +Exif.GPSInfo.GPSLongitudeRef Ascii 2 West +Exif.GPSInfo.GPSLongitude Rational 3 0deg 44' 27" +Exif.GPSInfo.GPSAltitudeRef Byte 1 Above sea level +Exif.GPSInfo.GPSAltitude Rational 1 104.2 m +Exif.GPSInfo.GPSTimeStamp Rational 3 10:34:11 +Exif.GPSInfo.GPSMapDatum Ascii 7 WGS-84 +Exif.GPSInfo.GPSProcessingMethod Undefined 18 HYBRID-FIX +Exif.GPSInfo.GPSAreaInformation Undefined 23 Surrey, England +Exif.GPSInfo.GPSDateStamp Ascii 20 2020:02:02 10:34:11 +""","""0x9286 Photo UserComment Undefined 12 charset="Unicode" AB +0x0000 GPSInfo GPSVersionID Byte 4 2 2 0 0 +0x0001 GPSInfo GPSLatitudeRef Ascii 2 N +0x0002 GPSInfo GPSLatitude Rational 3 51/1 23/1 13/1 +0x0003 GPSInfo GPSLongitudeRef Ascii 2 W +0x0004 GPSInfo GPSLongitude Rational 3 0/1 44/1 27/1 +0x0005 GPSInfo GPSAltitudeRef Byte 1 0 +0x0006 GPSInfo GPSAltitude Rational 1 10420/100 +0x0007 GPSInfo GPSTimeStamp Rational 3 10/1 34/1 11/1 +0x0012 GPSInfo GPSMapDatum Ascii 7 WGS-84 +0x001b GPSInfo GPSProcessingMethod Undefined 18 charset="Ascii" HYBRID-FIX +0x001c GPSInfo GPSAreaInformation Undefined 23 Surrey, England +0x001d GPSInfo GPSDateStamp Ascii 20 2020:02:02 10:34:11 +""","","""Exif.Photo.UserComment Undefined 25 how now brown cow +""","""0x9286 Photo UserComment Undefined 25 charset="Ascii" how now brown cow +""","","""Exif.Photo.UserComment Undefined 12 AB +""","""0x9286 Photo UserComment Undefined 12 charset="Unicode" AB +""","","""Exif.Photo.UserComment Undefined 19 hello world +""","""0x9286 Photo UserComment Undefined 19 hello world +""","","","""Exif.GPSInfo.GPSProcessingMethod Undefined 18 Robin +Exif.GPSInfo.GPSAreaInformation Undefined 24 area information +""","""0x001b GPSInfo GPSProcessingMethod Undefined 18 charset="Unicode" Robin +0x001c GPSInfo GPSAreaInformation Undefined 24 charset="Ascii" area information +""" + ] + stderr = [""]*len(commands) + retval = [ 0]*len(commands) diff --git a/tests/bugfixes/github/test_issue_987.py b/tests/bugfixes/github/test_issue_987.py deleted file mode 100644 index 397f7a81..00000000 --- a/tests/bugfixes/github/test_issue_987.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -from system_tests import CaseMeta, path -import zlib - -class tagListTest(metaclass=CaseMeta): - def compare_stdout(self, i, command, got_stdout, expected_stdout): - lines = got_stdout.split('\n') - count = len(lines); - checksum = zlib.adler32(got_stdout.encode()) - new_got = "%s,%s" % (count, checksum) - return super().compare_stdout(i, command, new_got, expected_stdout) - - commands = ["$taglist --help", - "$taglist all", - "$taglist ALL", - "$taglist Groups", - "$taglist nothing", - ] - stdout = ["8,198867862", - "5426,1072295739", - "5426,838787056", - "107,430791180", - "8,198867862", - ] - - stderr = ["","","","","Unexpected argument nothing\n"] - retval = [ 0,0, 0, 0, 2] From db1be4ae8e1077949fcb6a960e93069d6a41b395 Mon Sep 17 00:00:00 2001 From: clanmills Date: Sun, 22 Mar 2020 20:56:38 +0000 Subject: [PATCH 07/10] fix_1046_pt-GPSProcessingMethod --- man/man1/exiv2.1 | 38 ++++++++++++++----- src/actions.cpp | 10 ++++- src/tags_int.cpp | 44 +++++++--------------- src/tiffcomposite_int.cpp | 25 ++++++++++-- test/data/IMG_0246.exv | Bin 15297 -> 15081 bytes test/data/geotag-test.out | 12 +++--- tests/bugfixes/redmine/test_issue_1024.py | 4 +- tests/bugfixes/redmine/test_issue_1137.py | 4 +- tests/bugfixes/redmine/test_issue_528.py | 4 +- 9 files changed, 86 insertions(+), 55 deletions(-) diff --git a/man/man1/exiv2.1 b/man/man1/exiv2.1 index 304b51ef..19d3bc76 100644 --- a/man/man1/exiv2.1 +++ b/man/man1/exiv2.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH EXIV2 1 "Aug 25, 2019" +.TH EXIV2 1 "March 22, 2020" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -533,14 +533,34 @@ The value is optional. Not providing any value is equivalent to an empty value ("") and is mainly useful to create an XMP array property, e.g., a bag. .sp 1 -The format of Exif \fBComment\fP values includes an optional charset -specification at the beginning: -.br -.B [charset=Ascii|Jis|Unicode|Undefined ]\fIcomment\fP +The format of Exif \fBComment\fP values include an optional charset +specification at the beginning. Comments are used by the tags Exif.Photo.UserComment, Exif.GPSInfo.GPSProcessingMethod +and Exif.GPSInfo.GPSAreaInformation. Comments are stored as Undefined tags with an 8 byte encoding +definition follow by the encoded data. The charset is specified as follows: .sp 1 -.B Undefined -is used by default if the value doesn't start with a charset -definition. +.B [charset=Ascii|Jis|Unicode|Undefined] \fIcomment\fP +.br +charset=Undefined is the default +.sp 1 +.nf +$ exiv2 -M'set Exif.Photo.UserComment charset=Ascii My photo' x.jpg +$ exiv2 -pa --grep UserComment x.jpg +Exif.Photo.UserComment Undefined 16 My photo +$ exiv2 -pv --grep UserComment x.jpg +0x9286 Photo UserComment Undefined 16 charset="Ascii" My photo + +$ exiv2 -M'set Exif.Photo.UserComment charset=Unicode \\u0052\\u006f\\u0062\\u0069\\u006e' x.jpg +$ exiv2 -pa --grep UserComment x.jpg +Exif.Photo.UserComment Undefined 18 Robin +$ exiv2 -pv --grep UserComment x.jpg +0x9286 Photo UserComment Undefined 18 charset="Unicode" Robin + +$ exiv2 -M'set Exif.GPSInfo.GPSProcessingMethod HYBRID-FIX' x.jpg +$ exiv2 -pa --grep ProcessingMethod x.jpg +Exif.GPSInfo.GPSProcessingMethod Undefined 18 HYBRID-FIX +$ exiv2 -pv --grep ProcessingMethod x.jpg +0x001b GPSInfo GPSProcessingMethod Undefined 18 HYBRID-FIX +.fi .sp 1 The format for an IPTC \fBDate\fP value is: .sp 1 @@ -661,7 +681,7 @@ Type Explanation The printing flag t = translated and is intended for human use. Scripts should never use translated values as they are localised and the format may change as Exiv2 evolves. The printing flag v reports the values recorded in the metadata and should be used by scripts. .ne 40 .SH CONFIGURATION FILE -Exiv2 can read an optional configuration file ~/.exiv2 on Unix systems and %USERPROFILE%\\exiv2.ini on Windows (using a Visual Studio build). Cygwin and MinGW/msys2 follow the unix convention and use ~/.exiv2 You can fine the location of the configuration file with the command: +Exiv2 can read an optional configuration file ~/.exiv2 on Unix systems and %USERPROFILE%\\exiv2.ini on Windows (using a Visual Studio build). Cygwin and MinGW/msys2 follow the unix convention and use ~/.exiv2 You can determine the location of the configuration file with the command: .br .sp 1 .nf diff --git a/src/actions.cpp b/src/actions.cpp index ff9f28b0..826d9e8b 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -696,7 +696,15 @@ namespace Action { return true; } bool done = false; - if (0 == strcmp(md.key().c_str(), "Exif.Photo.UserComment")) { + // handle `comment` typeIDs + // $ bin/taglist | grep '\tComment,' | cut -d, -f 5 + // Exif.Photo.UserComment + // Exif.GPSInfo.GPSProcessingMethod + // Exif.GPSInfo.GPSAreaInformation + if( md.key() == "Exif.Photo.UserComment" + || md.key() == "Exif.GPSInfo.GPSProcessingMethod" + || md.key() == "Exif.GPSInfo.GPSAreaInformation" + ) { const Exiv2::CommentValue* pcv = dynamic_cast(&md.value()); if (pcv) { Exiv2::CommentValue::CharsetId csId = pcv->charsetId(); diff --git a/src/tags_int.cpp b/src/tags_int.cpp index add81946..8688d26f 100644 --- a/src/tags_int.cpp +++ b/src/tags_int.cpp @@ -1908,13 +1908,12 @@ namespace Exiv2 { gpsId, gpsTags, unsignedRational, 1, printValue), TagInfo(0x001b, "GPSProcessingMethod", N_("GPS Processing Method"), N_("A character string recording the name of the method used for location finding. " - "The first byte indicates the character code used, and this is followed by the name " - "of the method."), - gpsId, gpsTags, undefined, 0, printValue), + "The string encoding is defined using the same scheme as UserComment."), + gpsId, gpsTags, comment, 0, print0x9286), TagInfo(0x001c, "GPSAreaInformation", N_("GPS Area Information"), - N_("A character string recording the name of the GPS area. The first byte indicates " - "the character code used, and this is followed by the name of the GPS area."), - gpsId, gpsTags, undefined, 0, printValue), + N_("A character string recording the name of the GPS area." + "The string encoding is defined using the same scheme as UserComment."), + gpsId, gpsTags, comment, 0, print0x9286), TagInfo(0x001d, "GPSDateStamp", N_("GPS Date Stamp"), N_("A character string recording date and time information relative to UTC " "(Coordinated Universal Time). The format is \"YYYY:MM:DD.\"."), @@ -2229,38 +2228,23 @@ namespace Exiv2 { std::ostream& printFloat(std::ostream& os, const Value& value, const ExifData*) { Rational r = value.toRational(); - if (r.second != 0) return os << static_cast(r.first) / r.second; - return os << "(" << value << ")"; + if (r.second != 0) { + os << value.toFloat() ; + } else { + os << "(" << value << ")"; + } + return os; } // printFloat std::ostream& printDegrees(std::ostream& os, const Value& value, const ExifData*) { std::ios::fmtflags f( os.flags() ); if (value.count() == 3) { - std::ostringstream oss; - oss.copyfmt(os); static const char* unit[] = { "deg", "'", "\"" }; - static const int prec[] = { 7, 5, 3 }; - int n; - for (n = 2; n > 0; --n) { - if (value.toRational(n).first != 0) break; + for (int i = 0; i < value.count() ; ++i) { + const int v = (int) (value.toFloat(i)+0.5f); // nearest integer + os << (i != 0? " " : "") << v << unit[i]; } - for (int i = 0; i < n + 1; ++i) { - const uint32_t z = (uint32_t) value.toRational(i).first; - const uint32_t d = (uint32_t) value.toRational(i).second; - if (d == 0) - { - os << "(" << value << ")"; - os.flags(f); - return os; - } - // Hack: Need Value::toDouble - double b = static_cast(z)/d; - const int p = z % d == 0 ? 0 : prec[i]; - os << std::fixed << std::setprecision(p) << b - << unit[i] << " "; - } - os.copyfmt(oss); } else { os << value; diff --git a/src/tiffcomposite_int.cpp b/src/tiffcomposite_int.cpp index 8c792c00..a6bf925b 100644 --- a/src/tiffcomposite_int.cpp +++ b/src/tiffcomposite_int.cpp @@ -1836,14 +1836,33 @@ namespace Exiv2 { return len; } // TiffImageEntry::doSizeImage + static const TagInfo* findTagInfo(uint16_t tag,IfdId group) + { + const TagInfo* result = NULL ; + const TagInfo* tags = group == exifId ? Internal::exifTagList() + : group == gpsId ? Internal::gpsTagList() + : NULL + ; + if ( tags ) { + for ( size_t idx = 0; result==NULL && tags[idx].tag_ != 0xffff; ++idx) { + if ( tags[idx].tag_ == tag ) { + result = tags+idx; + } + } + } + return result; + } + // ************************************************************************* // free functions TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) { TypeId ti = TypeId(tiffType); - // On the fly type conversion for Exif.Photo.UserComment - if (tag == 0x9286 && group == exifId && ti == undefined) { - ti = comment; + // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation + if ( const TagInfo* pTag = ti == undefined ? findTagInfo(tag,group) : NULL ) { + if ( pTag->typeId_ == comment ) { + ti = comment; + } } // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature diff --git a/test/data/IMG_0246.exv b/test/data/IMG_0246.exv index 63d34c738c0ee3ab6194911e13b9e8a480ac68d5..bf54ec9f0b4803cd9685f3b1f1f6eb97aaea9f38 100644 GIT binary patch delta 251 zcmX?D{<4(&Kcj0!W|`6dhlX_%xhJrNNii@qNpD=J$H>IPF!>^5l9U2agl`cm10w?i z0|$`J4`mBTP4;C9Vv>;BypSnJoIBLd)7js}mBEq0X|jm4KO@iN6lq1tH$V-{3`{`C zzz`0^EDWqbK9HU~Pg>kgMw)?v9V(&%WD5b+u>)mofNW_XO9;qz0kUO)Y;hnv49J!R zsu2OQ^Q0#~moAV1vcMp?w5TYxQb)lxFFhwQFNI-pxQrIx1&}$65U1aep4=}Z#`HjX J^Kuy}c>oOhEYSb} delta 242 zcmaD^da#`PKcj0!W|`6dhelx&xhJp%Ni#4+$!uJx$H>INIQb%Dl9UWkgl`cm10w?i z0}GJN4`uU6PxfUBViJ+wypSnJeDiG{PR7YnQofAblQX0glkNajGBYp%Ap=7=NGAg; zkk7#I1t< Date: Mon, 23 Mar 2020 08:51:46 +0000 Subject: [PATCH 08/10] Fixing Windows Build Breaker (on Appveyor 2015 and 2017). Use """ string syntax on 'set Bla.Dee.Bla' commands. --- tests/bugfixes/github/test_issue_1046.py | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/bugfixes/github/test_issue_1046.py b/tests/bugfixes/github/test_issue_1046.py index 3f141bf5..0090019c 100644 --- a/tests/bugfixes/github/test_issue_1046.py +++ b/tests/bugfixes/github/test_issue_1046.py @@ -6,21 +6,22 @@ from system_tests import CaseMeta, CopyFiles, path class test_issue_1046Test(metaclass=CaseMeta): filename = path("$data_path/IMG_0246_copy.exv") - commands = ["$exiv2 -pt -g GPSInfo -g UserCom $filename" - ,"$exiv2 -pv -g GPSInfo -g UserCom $filename" - ,"$exiv2 -M'set Exif.Photo.UserComment charset=Ascii how now brown cow' $filename" - ,"$exiv2 -pt -g UserComment $filename" - ,"$exiv2 -pv -g UserComment $filename" - ,"$exiv2 -M'set Exif.Photo.UserComment charset=Unicode \u0041\u0042' $filename" - ,"$exiv2 -pt -g UserComment $filename" - ,"$exiv2 -pv -g UserComment $filename" - ,"$exiv2 -M'set Exif.Photo.UserComment hello world' $filename" - ,"$exiv2 -pt -g UserComment $filename" - ,"$exiv2 -pv -g UserComment $filename" - ,"$exiv2 -M'set Exif.GPSInfo.GPSProcessingMethod charset=Unicode \u0052\u006f\u0062\u0069\u006e' $filename" - ,"$exiv2 -M'set Exif.GPSInfo.GPSAreaInformation charset=Ascii area information' $filename" - ,"$exiv2 -pt -g GPSPro -g GPSArea $filename" - ,"$exiv2 -pv -g GPSPro -g GPSArea $filename" + # Use the """ string syntax for -M"set Bla.Dee.Bla" commands to ensure they run on Windows! + commands = [ "$exiv2 -pt -g GPSInfo -g UserCom $filename" + , "$exiv2 -pv -g GPSInfo -g UserCom $filename" + ,"""$exiv2 -M"set Exif.Photo.UserComment charset=Ascii how now brown cow" $filename""" + , "$exiv2 -pt -g UserComment $filename" + , "$exiv2 -pv -g UserComment $filename" + ,"""$exiv2 -M"set Exif.Photo.UserComment charset=Unicode \u0041\u0042" $filename""" + , "$exiv2 -pt -g UserComment $filename" + , "$exiv2 -pv -g UserComment $filename" + ,"""$exiv2 -M"set Exif.Photo.UserComment hello world" $filename""" + , "$exiv2 -pt -g UserComment $filename" + , "$exiv2 -pv -g UserComment $filename" + ,"""$exiv2 -M"set Exif.GPSInfo.GPSProcessingMethod charset=Unicode \u0052\u006f\u0062\u0069\u006e" $filename""" + ,"""$exiv2 -M"set Exif.GPSInfo.GPSAreaInformation charset=Ascii area information" $filename""" + , "$exiv2 -pt -g GPSPro -g GPSArea $filename" + , "$exiv2 -pv -g GPSPro -g GPSArea $filename" ] stdout = ["""Exif.Photo.UserComment Undefined 12 AB Exif.GPSInfo.GPSVersionID Byte 4 2.2.0.0 From b258a3ed9fc49e063b33c4a2c4f74400f8018485 Mon Sep 17 00:00:00 2001 From: clanmills Date: Mon, 23 Mar 2020 20:10:28 +0000 Subject: [PATCH 09/10] Documentation Update. Cygwin/32 and MinGW/32 platforms are obsolete. MacOS-X renamed as macOS --- README.md | 59 +++++++++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 71bcc0a1..250a343c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ 3. [Unit tests](#4-3) 5. [Platform Notes](#5) 1. [Linux](#5-1) - 2. [MacOS-X](#5-2) + 2. [macOS](#5-2) 3. [MinGW](#5-3) 4. [Cygwin](#5-4) 5. [Microsoft Visual C++](#5-5) @@ -61,14 +61,14 @@ The file ReadMe.txt in a Build bundle describes how to install the library on th ## 2 Building, Installing, Using and Uninstalling Exiv2 -You need [CMake](https://cmake.org/download/) to configure the Exiv2 project and a C++11 compiler. +You need [CMake](https://cmake.org/download/) to configure the Exiv2 project and the GCC or Clang compiler and associated tool chain.
### 2.1 Build, Install, Use Exiv2 on a UNIX-like system ```bash -cd $EXIV_ROOT +cd ~/gnu/github/exiv2 # location of the project code mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . @@ -90,7 +90,7 @@ You will also need to locate libexiv2 at run time: ```bash $ export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" # Linux, Cygwin, MinGW/msys2 -$ export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" # MacOS-X +$ export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" # macOS ``` @@ -165,7 +165,7 @@ See [README-CONAN](README-CONAN.md) for more information. There are detailed platform notes about compiling and linking in `releasenotes/{platform}/ReadMe.txt` -where `platform: { CYGWIN | Darwin | Linux | MinGW | msvc }` +where `platform: { CYGWIN | macOS | Linux | MinGW | msvc }` In general you need to do the following: @@ -249,7 +249,7 @@ g++ -std=c++98 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags) ### 2.8 Localisation -Localisation is supported on a UNIX-like platform: Linux, MacOS-X, Cygwin and MinGW/msys2. Localisation is not supported for Visual Studio builds. +Localisation is supported on a UNIX-like platform: Linux, macOS, Cygwin and MinGW/msys2. Localisation is not supported for Visual Studio builds. To build localisation support, use the CMake option `-DEXIV2_ENABLE_NLS=ON`. You must install the `gettext` package with your package manager or from source. The `gettext` package is available from [http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/) and includes the library `libintl` and utilities to build localisation files. If CMake produces error messages which mention libintl or gettext, you should verify that the package `gettext` has been correctly built and installed. @@ -515,7 +515,7 @@ $ cmake .. $ cmake --build . ``` -2) On MacOS-X +2) On macOS Apple provide clang with Xcode. GCC has not been supported by Apple since 2013. The _"normal unix build"_ uses Clang. @@ -525,7 +525,7 @@ I have been unable to get clang to work on any of those platforms. 4) Cross Compiling -I've never succeeded in getting this to work. I use different VMs for Linux 32 and 64 bit. I've documented how to set up Cygwin and MinGW/msys2 for 64 and 32 bit builds in [README-CONAN](README-CONAN.md) +I've never succeeded in getting this to work. I use different VMs for Linux 32 and 64 bit. I've documented how to set up Cygwin and MinGW/msys2 in [README-CONAN](README-CONAN.md) [TOC](#TOC)
@@ -733,9 +733,9 @@ $ make [TOC](#TOC)
-### 5.2 MacOS-X +### 5.2 macOS -You will need to install Xcode and the Xcode command-line tools to build on the Mac. +You will need to install Xcode and the Xcode command-line tools to build on macOS. You should build and install libexpat and zlib. You may use brew, macports, build from source, or use conan. @@ -746,14 +746,12 @@ I recommend that you build and install CMake from source. ### 5.3 MinGW -We provide support for both 64bit and 32bit builds using MinGW/msys2. [https://www.msys2.org](https://www.msys2.org) - -Support for MinGW/msys1.0 32 bit build was provided for Exiv2 v0.26. MinGW/msys1.0 is not supported by Team Exiv2 for Exiv2 v0.27 and later. +Please note that the platform MinGW/msys2 32 is obsolete and superceded by MinGW/msys2 64. There is a discussion on the web about installing GTest: [https://github.com/Exiv2/exiv2/issues/575](https://github.com/Exiv2/exiv2/issues/575) #### MinGW/msys2 64 bit -Install: [http://repo.msys2.org/distrib/x86\_64/msys2-x86\_64-20180531.exe](http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe) +Install: [http://repo.msys2.org/distrib/x86_64/msys2-x86\_64-20190524.exe](http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe) I use the following batch file to start the MinGW/msys2 64 bit bash shell from the Dos Command Prompt (cmd.exe) @@ -769,23 +767,6 @@ c:\msys64\usr\bin\bash.exe -norc ``` -#### MinGW/msys2 32 bit -Install: [http://repo.msys2.org/distrib/i686/msys2-i686-20180531.exe](http://repo.msys2.org/distrib/i686/msys2-i686-20180531.exe) - -I use the following batch file to start the MinGW/msys2 32 bit bash shell from the Dos Command Prompt (cmd.exe) - -```bat -@echo off -setlocal -set "PS1=\! MSYS32:\u@\h:\w \$ " -set PATH="/usr/local/bin/:/usr/bin:/mingw32/bin:/bin:/usr/sbin:/sbin" -set "HOME=c:\msys32\home\%USERNAME%" -if NOT EXIST %HOME% mkdir %HOME% -cd %HOME% -c:\msys32\usr\bin\bash.exe -norc - -``` - #### Install MinGW Dependencies Install tools and dependencies: @@ -794,12 +775,6 @@ Install tools and dependencies: $ for i in base-devel git cmake coreutils python3 man gcc gdb make dos2unix diffutils zlib-devel libexpat-devel libiconv-devel gettext-devel; do (echo y|pacman -S $i); done ``` -You can upgrade all installed packages on your system with the following command. For me, this broke msys32 and I had to reinstall msys32 and all the dependencies. Your experience may be different. - -```bash -$ pacman -Syu -``` - #### Download exiv2 from github and build ```bash @@ -826,9 +801,11 @@ $ [TOC](#TOC)
-### 5.4 Cygwin +### 5.4 Cygwin/64 -Download: [https://cygwin.com/install.html](https://cygwin.com/install.html) and run setup-x86_64.exe for 64 Bit Cygwin, or setup-x86.exe for 32 bit Cygwin. I install into c:\\cygwin64 and c:\\cygwin32 +Please note that the platform Cygwin/32 is obsolete and superceded by Cygwin/64. + +Download: [https://cygwin.com/install.html](https://cygwin.com/install.html) and run setup-x86_64.exe. I install into c:\\cygwin64 You need: make, cmake, gcc, gettext-devel pkg-config, dos2unix, zlib-devel, libexpat1-devel, git, python3-interpreter, libiconv, libxml2-utils, libncurses. @@ -840,7 +817,7 @@ There is a discussion on the web about installing GTest: [https://github.com/Exi Download and build cmake from source because I can't get the cygwin installed cmake 3.6.2 to work. To build cmake from source, you need libncurses. [https://cmake.org/download/](https://cmake.org/download/) -I use the following batch file "cygwin64.bat" to start the Cygwin/64 bit bash shell from the Dos Command Prompt (cmd.exe). +I use the following batch file "cygwin64.bat" to start the Cygwin/64 bash shell from the Dos Command Prompt (cmd.exe). ```bat @echo off @@ -930,4 +907,4 @@ Work in progress: [https://github.com/Exiv2/exiv2/issues/902](https://github.co Robin Mills -Revised: 2019-08-03 +Revised: 2020-03-23 From 7a9a0757ab01ca5e51d68c66d8b965866298e061 Mon Sep 17 00:00:00 2001 From: clanmills Date: Wed, 25 Mar 2020 12:04:59 +0000 Subject: [PATCH 10/10] Pointless change to trigger CI to build (appveyor panick). --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 250a343c..6b7405c8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ | [![Build Status](https://travis-ci.org/Exiv2/exiv2.svg?branch=0.27-maintenance)](https://travis-ci.org/Exiv2/exiv2) | [![Build status](https://ci.appveyor.com/api/projects/status/d6vxf2n0cp3v88al/branch/0.27-maintenance?svg=true)](https://ci.appveyor.com/project/piponazo/exiv2-wutfp/branch/0.27-maintenance) | [![pipeline status](https://gitlab.com/D4N/exiv2/badges/0.27-maintenance/pipeline.svg)](https://gitlab.com/D4N/exiv2/commits/0.27-maintenance) | [![codecov](https://codecov.io/gh/Exiv2/exiv2/branch/0.27-maintenance/graph/badge.svg)](https://codecov.io/gh/Exiv2/exiv2) | [![Packaging status](https://repology.org/badge/tiny-repos/exiv2.svg)](https://repology.org/metapackage/exiv2/versions) |
-### TABLE OF CONTENTS +### TABLE OF CONTENTS 1. [Welcome to Exiv2](#1) 2. [Building, Installing, Using and Uninstalling Exiv2](#2)