Changed CI build default -DEXIV2_ENABLE_BMFF=On. Fixed suite to run with/without bmff. -pS and -pR same for bmff.
This commit is contained in:
parent
0e1412ad44
commit
55d2201892
@ -6,7 +6,7 @@ git:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- COMMON_CMAKE_OPTIONS="-DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_INSTALL_PREFIX=install"
|
- COMMON_CMAKE_OPTIONS="-DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_INSTALL_PREFIX=install"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|||||||
@ -74,7 +74,7 @@ build_script:
|
|||||||
- cmd: conan --version
|
- cmd: conan --version
|
||||||
- cmd: conan install .. -o webready=%WEBREADY% --build missing
|
- cmd: conan install .. -o webready=%WEBREADY% --build missing
|
||||||
- cmd: echo %CMAKE_GENERATOR%
|
- cmd: echo %CMAKE_GENERATOR%
|
||||||
- cmd: cmake -G "%CMAKE_GENERATOR%" -DEXIV2_TEAM_WARNINGS_AS_ERRORS=%WARNINGS_AS_ERRORS% -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=%WEBREADY% -DEXIV2_BUILD_UNIT_TESTS=%UNIT_TESTS% -DCMAKE_INSTALL_PREFIX=install ..
|
- cmd: cmake -G "%CMAKE_GENERATOR%" -DEXIV2_TEAM_WARNINGS_AS_ERRORS=%WARNINGS_AS_ERRORS% -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_BMFF=ON -DEXIV2_ENABLE_WEBREADY=%WEBREADY% -DEXIV2_BUILD_UNIT_TESTS=%UNIT_TESTS% -DCMAKE_INSTALL_PREFIX=install ..
|
||||||
- cmd: cmake --build . --config Release
|
- cmd: cmake --build . --config Release
|
||||||
- cmd: cmake --build . --config Release --target install
|
- cmd: cmake --build . --config Release --target install
|
||||||
- cmd: cd bin
|
- cmd: cd bin
|
||||||
|
|||||||
@ -117,7 +117,7 @@ if __name__ == '__main__':
|
|||||||
type=str,
|
type=str,
|
||||||
nargs='?',
|
nargs='?',
|
||||||
default="-DEXIV2_TEAM_EXTRA_WARNINGS=ON -DEXIV2_ENABLE_VIDEO=ON "
|
default="-DEXIV2_TEAM_EXTRA_WARNINGS=ON -DEXIV2_ENABLE_VIDEO=ON "
|
||||||
"-DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON "
|
"-DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_BMFF=ON "
|
||||||
"-DBUILD_WITH_CCACHE=ON -DEXIV2_ENABLE_CURL=ON"
|
"-DBUILD_WITH_CCACHE=ON -DEXIV2_ENABLE_CURL=ON"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,6 @@ add_library( exiv2lib
|
|||||||
../include/exiv2/rwlock.hpp
|
../include/exiv2/rwlock.hpp
|
||||||
../include/exiv2/slice.hpp
|
../include/exiv2/slice.hpp
|
||||||
basicio.cpp ../include/exiv2/basicio.hpp
|
basicio.cpp ../include/exiv2/basicio.hpp
|
||||||
bmffimage.cpp ../include/exiv2/bmffimage.hpp
|
|
||||||
bmpimage.cpp ../include/exiv2/bmpimage.hpp
|
bmpimage.cpp ../include/exiv2/bmpimage.hpp
|
||||||
convert.cpp ../include/exiv2/convert.hpp
|
convert.cpp ../include/exiv2/convert.hpp
|
||||||
cr2image.cpp ../include/exiv2/cr2image.hpp
|
cr2image.cpp ../include/exiv2/cr2image.hpp
|
||||||
@ -119,6 +118,12 @@ if( EXIV2_ENABLE_VIDEO )
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( EXIV2_ENABLE_BMFF )
|
||||||
|
target_sources(exiv2lib PRIVATE
|
||||||
|
bmffimage.cpp ../include/exiv2/bmffimage.hpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Other library target properties
|
# Other library target properties
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -188,15 +188,14 @@ namespace Exiv2
|
|||||||
|
|
||||||
long BmffImage::boxHandler(std::ostream& out /* = std::cout*/ , Exiv2::PrintStructureOption option /* = kpsNone */,int depth /* =0 */)
|
long BmffImage::boxHandler(std::ostream& out /* = std::cout*/ , Exiv2::PrintStructureOption option /* = kpsNone */,int depth /* =0 */)
|
||||||
{
|
{
|
||||||
long result = (long)io_->size();
|
long result = (long)io_->size();
|
||||||
long address = (long)io_->tell();
|
long address = (long)io_->tell();
|
||||||
if (visits_.find(address) != visits_.end() || visits_.size() > visits_max_) {
|
if (visits_.find(address) != visits_.end() || visits_.size() > visits_max_) {
|
||||||
throw Error(kerCorruptedMetadata);
|
throw Error(kerCorruptedMetadata);
|
||||||
}
|
}
|
||||||
visits_.insert(address);
|
visits_.insert(address);
|
||||||
|
|
||||||
bool bTrace = (option == kpsBasic && depth == 0) || option == kpsRecursive ;
|
bool bTrace = option == kpsBasic || option == kpsRecursive ;
|
||||||
Exiv2::PrintStructureOption recursion = option == kpsBasic ? kpsNone : option ;
|
|
||||||
#ifdef EXIV2_DEBUG_MESSAGES
|
#ifdef EXIV2_DEBUG_MESSAGES
|
||||||
bTrace = true ;
|
bTrace = true ;
|
||||||
#endif
|
#endif
|
||||||
@ -266,7 +265,7 @@ namespace Exiv2
|
|||||||
|
|
||||||
io_->seek(skip, BasicIo::cur);
|
io_->seek(skip, BasicIo::cur);
|
||||||
while (n-- > 0) {
|
while (n-- > 0) {
|
||||||
io_->seek(boxHandler(out,recursion,depth + 1), BasicIo::beg);
|
io_->seek(boxHandler(out,option,depth + 1), BasicIo::beg);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
@ -300,7 +299,7 @@ namespace Exiv2
|
|||||||
}
|
}
|
||||||
io_->seek(skip, BasicIo::cur);
|
io_->seek(skip, BasicIo::cur);
|
||||||
while ((long)io_->tell() < (long)(address + box.length)) {
|
while ((long)io_->tell() < (long)(address + box.length)) {
|
||||||
io_->seek(boxHandler(out,recursion,depth + 1), BasicIo::beg);
|
io_->seek(boxHandler(out,option,depth + 1), BasicIo::beg);
|
||||||
}
|
}
|
||||||
// post-process meta box to recover Exif and XMP
|
// post-process meta box to recover Exif and XMP
|
||||||
if (box.type == TAG_meta) {
|
if (box.type == TAG_meta) {
|
||||||
@ -423,7 +422,7 @@ namespace Exiv2
|
|||||||
}
|
}
|
||||||
if (name == "cano") {
|
if (name == "cano") {
|
||||||
while ((long)io_->tell() < (long)(address + box.length)) {
|
while ((long)io_->tell() < (long)(address + box.length)) {
|
||||||
io_->seek(boxHandler(out,recursion,depth + 1), BasicIo::beg);
|
io_->seek(boxHandler(out,option,depth + 1), BasicIo::beg);
|
||||||
}
|
}
|
||||||
} else if ( name == "xmp" ) {
|
} else if ( name == "xmp" ) {
|
||||||
parseXmp(box.length,io_->tell());
|
parseXmp(box.length,io_->tell());
|
||||||
|
|||||||
@ -2,16 +2,61 @@
|
|||||||
|
|
||||||
import system_tests
|
import system_tests
|
||||||
|
|
||||||
|
from system_tests import BT
|
||||||
|
import os
|
||||||
|
import shlex
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def chop(blob):
|
||||||
|
lines=[]
|
||||||
|
line=''
|
||||||
|
for c in blob.decode('utf-8'):
|
||||||
|
if c == '\n':
|
||||||
|
lines=lines+[line]
|
||||||
|
line=''
|
||||||
|
elif c != '\r':
|
||||||
|
line=line+str(c)
|
||||||
|
if len(line) != 0:
|
||||||
|
lines=lines+line
|
||||||
|
return lines
|
||||||
|
|
||||||
|
def runTest(cmd):
|
||||||
|
try:
|
||||||
|
p = subprocess.Popen( shlex.split(cmd), stdout=subprocess.PIPE,shell=False)
|
||||||
|
out,err = p.communicate()
|
||||||
|
if p.returncode != 0:
|
||||||
|
print('%s returncode = %d' % (cmd,p.returncode) )
|
||||||
|
out=chop(out)
|
||||||
|
except:
|
||||||
|
error('%s died' % cmd )
|
||||||
|
return out
|
||||||
|
|
||||||
class pr_1475_hif_Sony(metaclass=system_tests.CaseMeta):
|
class pr_1475_hif_Sony(metaclass=system_tests.CaseMeta):
|
||||||
url = "https://github.com/Exiv2/exiv2/pull/1475"
|
url = "https://github.com/Exiv2/exiv2/pull/1475"
|
||||||
|
bSkip=False
|
||||||
|
|
||||||
filename = "$data_path/Sony.HIF"
|
# test needs enable_bmff=1
|
||||||
commands = ["$exiv2 -g Image.Make -g Date -g Xm -g Expo -g Flash $filename"
|
exiv2_exe=os.path.join(BT.Config.bin_dir, "exiv2")
|
||||||
,"$exiv2 -pR $filename"
|
bSkip = bSkip or runTest(exiv2_exe + " -vVg enable_bmff")[-1] != "enable_bmff=1"
|
||||||
,"$exiv2 -pX $filename"
|
if bSkip:
|
||||||
,"$exiv2 -pC $filename"
|
commands=[]
|
||||||
]
|
retval=[]
|
||||||
stdout = ["""Exif.Image.Make Ascii 5 SONY
|
stdin=[]
|
||||||
|
stderr=[]
|
||||||
|
stdout=[]
|
||||||
|
print("*** test skipped ***")
|
||||||
|
else:
|
||||||
|
filename = "$data_path/Sony.HIF"
|
||||||
|
commands = ["$exiv2 -g Image.Make -g Date -g Xm -g Expo -g Flash $filename"
|
||||||
|
,"$exiv2 -pS $filename"
|
||||||
|
,"$exiv2 -pX $filename"
|
||||||
|
,"$exiv2 -pC $filename"
|
||||||
|
]
|
||||||
|
retval = [ 0 ] * len(commands)
|
||||||
|
stderr = [ "" ] * len(commands)
|
||||||
|
stdin = [ "" ] * len(commands)
|
||||||
|
stdout = ["""Exif.Image.Make Ascii 5 SONY
|
||||||
Exif.Image.DateTime Ascii 20 2021:02:18 19:55:41
|
Exif.Image.DateTime Ascii 20 2021:02:18 19:55:41
|
||||||
Exif.Photo.ExposureTime Rational 1 1/1000 s
|
Exif.Photo.ExposureTime Rational 1 1/1000 s
|
||||||
Exif.Photo.ExposureProgram Short 1 Manual
|
Exif.Photo.ExposureProgram Short 1 Manual
|
||||||
@ -111,21 +156,33 @@ Exiv2::BmffImage::boxHandler: mdat 4088->147464
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?xpacket end="w"?>""",""
|
<?xpacket end="w"?>""",""]
|
||||||
]
|
|
||||||
retval = [ 0 ] * len(commands)
|
|
||||||
stderr = [ "" ] * len(commands)
|
|
||||||
|
|
||||||
class pr_1475_hif_Canon(metaclass=system_tests.CaseMeta):
|
class pr_1475_hif_Canon(metaclass=system_tests.CaseMeta):
|
||||||
url = "https://github.com/Exiv2/exiv2/pull/1475"
|
url = "https://github.com/Exiv2/exiv2/pull/1475"
|
||||||
|
bSkip=False
|
||||||
|
|
||||||
filename = "$data_path/Canon.HIF"
|
# test needs enable_bmff=1
|
||||||
commands = ["$exiv2 -g Image.Make -g Date -g Xm -g Expo -g Flash $filename"
|
exiv2_exe=os.path.join(BT.Config.bin_dir, "exiv2")
|
||||||
,"$exiv2 -pR $filename"
|
bSkip = bSkip or runTest(exiv2_exe + " -vVg enable_bmff")[-1] != "enable_bmff=1"
|
||||||
,"$exiv2 -pX $filename"
|
if bSkip:
|
||||||
,"$exiv2 -pC $filename"
|
commands=[]
|
||||||
]
|
retval=[]
|
||||||
stdout = ["""Exif.Image.Make Ascii 6 Canon
|
stdin=[]
|
||||||
|
stderr=[]
|
||||||
|
stdin=[]
|
||||||
|
print("*** skipped. test requires both enable_bmff and debug***")
|
||||||
|
else:
|
||||||
|
filename = "$data_path/Canon.HIF"
|
||||||
|
commands = ["$exiv2 -g Image.Make -g Date -g Xm -g Expo -g Flash $filename"
|
||||||
|
,"$exiv2 -pS $filename"
|
||||||
|
,"$exiv2 -pX $filename"
|
||||||
|
,"$exiv2 -pC $filename"
|
||||||
|
]
|
||||||
|
retval = [ 0 ] * len(commands)
|
||||||
|
stderr = [ "" ] * len(commands)
|
||||||
|
stdin = [ "" ] * len(commands)
|
||||||
|
stdout = ["""Exif.Image.Make Ascii 6 Canon
|
||||||
Exif.Image.DateTime Ascii 20 2021:02:18 19:54:47
|
Exif.Image.DateTime Ascii 20 2021:02:18 19:54:47
|
||||||
Exif.Photo.ExposureTime Rational 1 1/1000 s
|
Exif.Photo.ExposureTime Rational 1 1/1000 s
|
||||||
Exif.Photo.ExposureProgram Short 1 Manual
|
Exif.Photo.ExposureProgram Short 1 Manual
|
||||||
@ -219,8 +276,5 @@ Exiv2::BmffImage::boxHandler: mdat 1195->1252197
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?xpacket end="w"?>""",""
|
<?xpacket end="w"?>""",""]
|
||||||
]
|
|
||||||
retval = [ 0 ] * len(commands)
|
|
||||||
stderr = [ "" ] * len(commands)
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user