Fix MSVC build breaker and modify test_pr_1475_HIF.py to run on Windows.

main
Robin Mills 4 years ago
parent 55d2201892
commit 71d29fe60b

@ -33,7 +33,17 @@ namespace Exiv2
{ {
EXIV2API bool enableBMFF(bool enable = true); EXIV2API bool enableBMFF(bool enable = true);
struct Iloc; // We'll define this in bmffimage.cpp struct Iloc
{
Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length){};
virtual ~Iloc(){};
uint32_t ID_;
uint32_t start_;
uint32_t length_;
std::string toString() const;
}; // class Iloc
// ***************************************************************************** // *****************************************************************************
// class definitions // class definitions

@ -89,20 +89,10 @@ namespace Exiv2
return enable; return enable;
} }
struct Iloc std::string Iloc::toString() const
{
Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length){};
virtual ~Iloc(){};
uint32_t ID_;
uint32_t start_;
uint32_t length_;
std::string toString() const
{ {
return Internal::stringFormat("ID = %u from,length = %u,%u", ID_, start_, length_); return Internal::stringFormat("ID = %u from,length = %u,%u", ID_, start_, length_);
} }
}; // class Iloc
BmffImage::BmffImage(BasicIo::AutoPtr io, bool /* create */) : Image(ImageType::bmff, mdExif | mdIptc | mdXmp, io) BmffImage::BmffImage(BasicIo::AutoPtr io, bool /* create */) : Image(ImageType::bmff, mdExif | mdIptc | mdXmp, io)
{ {
@ -388,7 +378,7 @@ namespace Exiv2
// 12.1.5.2 // 12.1.5.2
case TAG_colr: { case TAG_colr: {
if ( data.size_ >= skip+4 +8 /* 8 for safety */ ) { // .____.HLino..__mntrR 2 0 0 0 0 12 72 76 105 110 111 2 16 ... if ( data.size_ >= (long) (skip+4+8) /* 8 for safety */ ) { // .____.HLino..__mntrR 2 0 0 0 0 12 72 76 105 110 111 2 16 ...
// https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf // https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf
uint8_t meth = data.pData_[skip+0]; uint8_t meth = data.pData_[skip+0];
uint8_t prec = data.pData_[skip+1]; uint8_t prec = data.pData_[skip+1];

@ -4,10 +4,18 @@ import system_tests
from system_tests import BT from system_tests import BT
import os import os
import sys
import shlex import shlex
import shutil import shutil
import subprocess import subprocess
# https://github.com/Exiv2/exiv2/issues/1215
def error(s):
print('**',s,'**')
def warn(s):
print('--',s)
def chop(blob): def chop(blob):
lines=[] lines=[]
line='' line=''
@ -22,8 +30,12 @@ def chop(blob):
return lines return lines
def runTest(cmd): def runTest(cmd):
if sys.platform == 'win32':
args = cmd
else:
args = shlex.split(cmd)
try: try:
p = subprocess.Popen( shlex.split(cmd), stdout=subprocess.PIPE,shell=False) p = subprocess.Popen( args, stdout=subprocess.PIPE,shell=False)
out,err = p.communicate() out,err = p.communicate()
if p.returncode != 0: if p.returncode != 0:
print('%s returncode = %d' % (cmd,p.returncode) ) print('%s returncode = %d' % (cmd,p.returncode) )

Loading…
Cancel
Save