https://github.com/Exiv2/exiv2/issues/11 Closed. Coincidentally Raphael reported issues with Visual Studio 2015 Community Edition. Issue 11 and Raphael's issues should now be resolved.

v0.27.3
Robin Mills 8 years ago
parent 620ef04e96
commit 82dbe6199d

@ -142,7 +142,7 @@ int WriteReadSeek(BasicIo &io)
throw Error(9, io.path(), strError());
}
IoCloser closer(io);
if ((size_t) io.write((byte*)tester1, size1) != size1) {
if ((size_t) io.write((byte*)tester1, (long)size1) != size1) {
std::cerr << ": WRS initial write failed\n";
return 2;
}
@ -195,7 +195,7 @@ int WriteReadSeek(BasicIo &io)
}
io.seek(insert, BasicIo::beg);
if((size_t)io.write((byte*)tester2, size2) != size2) {
if((size_t)io.write((byte*)tester2, (long)size2) != size2) {
std::cerr << ": WRS bad write 1\n";
return 9;
}

@ -20,7 +20,7 @@ try {
if (io.open() != 0) {
throw Exiv2::Error(9, io.path(), Exiv2::strError());
}
Exiv2::DataBuf buf(io.size());
Exiv2::DataBuf buf((long)io.size());
std::cout << "Reading " << buf.size_ << " bytes from " << data << "\n";
io.read(buf.pData_, buf.size_);
if (io.error() || !io.eof()) throw Exiv2::Error(14);

@ -24,7 +24,7 @@ try {
}
// Map it to memory
const Exiv2::byte* pData = file.mmap();
long size = file.size();
long size = (long)file.size();
DataBuf buf(size);
// Read from the memory mapped region
memcpy(buf.pData_, pData, buf.size_);

@ -1674,7 +1674,7 @@ namespace Exiv2 {
while (blockIndex < nBlocks && !src.eof() && !findDiff) {
blockSize = p_->blocksMap_[blockIndex].getSize();
bool isFakeData = p_->blocksMap_[blockIndex].isKnown(); // fake data
readCount = src.read(buf, blockSize);
readCount = (size_t) src.read(buf, (long) blockSize);
byte* blockData = p_->blocksMap_[blockIndex].getData();
for (i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) {
if ((!isFakeData && buf[i] != blockData[i]) || (isFakeData && buf[i] != 0)) {
@ -1695,7 +1695,7 @@ namespace Exiv2 {
findDiff = true;
} else {
bool isFakeData = p_->blocksMap_[blockIndex].isKnown(); // fake data
readCount = src.read(buf, blockSize);
readCount = src.read(buf, (long) blockSize);
byte* blockData = p_->blocksMap_[blockIndex].getData();
for (i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) {
if ((!isFakeData && buf[readCount - i - 1] != blockData[blockSize - i - 1]) || (isFakeData && buf[readCount - i - 1] != 0)) {
@ -1713,15 +1713,15 @@ namespace Exiv2 {
if (buf) std::free(buf);
// submit to the remote machine.
long dataSize = src.size() - left - right;
long dataSize = (long) (src.size() - left - right);
if (dataSize > 0) {
byte* data = (byte*) std::malloc(dataSize);
src.seek(left, BasicIo::beg);
src.read(data, dataSize);
p_->writeRemote(data, (size_t)dataSize, left, (long) p_->size_ - right);
p_->writeRemote(data, (size_t)dataSize, (long)left, (long) (p_->size_ - right));
if (data) std::free(data);
}
return src.size();
return (long) src.size();
}
int RemoteIo::putb(byte /*unused data*/)

@ -113,7 +113,7 @@ namespace Exiv2 {
iptcData_,
xmpData_,
io_->mmap(),
io_->size());
(uint32_t) io_->size());
setByteOrder(bo);
} // Cr2Image::readMetadata
@ -130,7 +130,7 @@ namespace Exiv2 {
// Ensure that this is the correct image type
if (isCr2Type(*io_, false)) {
pData = io_->mmap(true);
size = io_->size();
size = (long) io_->size();
Cr2Header cr2Header;
if (0 == cr2Header.read(pData, 16)) {
bo = cr2Header.byteOrder();

@ -137,11 +137,11 @@ namespace Exiv2 {
std::ofstream devnull;
printStructure(devnull,kpsRecursive,0);
} catch (Exiv2::Error& /* e */) {
DataBuf file(io().size());
DataBuf file( (long) io().size());
io_->read(file.pData_,file.size_);
}
CrwParser::decode(this, io_->mmap(), io_->size());
CrwParser::decode(this, io_->mmap(), (uint32_t) io_->size());
} // CrwImage::readMetadata
@ -157,7 +157,7 @@ namespace Exiv2 {
// Ensure that this is the correct image type
if (isCrwType(*io_, false)) {
// Read the image into a memory buffer
buf.alloc(io_->size());
buf.alloc((long) io_->size());
io_->read(buf.pData_, buf.size_);
if (io_->error() || io_->eof()) {
buf.reset();

@ -718,7 +718,7 @@ namespace Exiv2 {
header.get(),
0);
if (mio1.size() <= 65527) {
append(blob, mio1.mmap(), mio1.size());
append(blob, mio1.mmap(), (uint32_t) mio1.size());
return wm;
}
@ -820,7 +820,7 @@ namespace Exiv2 {
TiffMapping::findEncoder,
header.get(),
0);
append(blob, mio2.mmap(), mio2.size());
append(blob, mio2.mmap(), (uint32_t) mio2.size());
#ifdef DEBUG
if (wm == wmIntrusive) {
std::cerr << "SIZE OF EXIF DATA IS " << std::dec << mio2.size() << " BYTES\n";
@ -897,7 +897,7 @@ namespace {
Exiv2::IptcData emptyIptc;
Exiv2::XmpData emptyXmp;
Exiv2::TiffParser::encode(io, 0, 0, Exiv2::littleEndian, thumb, emptyIptc, emptyXmp);
return io.read(io.size());
return io.read((long) io.size());
}
const char* JpegThumbnail::mimeType() const

@ -735,7 +735,7 @@ namespace Exiv2
std::cout << "Exiv2::Jp2Image::doWriteMetadata: Null Box size has been found. "
"This is the last box of file." << std::endl;
#endif
box.length = io_->size() - io_->tell() + 8;
box.length = (uint32_t) (io_->size() - io_->tell() + 8);
}
if (box.length == 1)
{

@ -125,7 +125,7 @@ namespace Exiv2 {
iptcData_,
xmpData_,
io_->mmap(),
io_->size());
(uint32_t) io_->size());
setByteOrder(bo);
} // OrfImage::readMetadata
@ -142,7 +142,7 @@ namespace Exiv2 {
// Ensure that this is the correct image type
if (isOrfType(*io_, false)) {
pData = io_->mmap(true);
size = io_->size();
size = (long) io_->size();
OrfHeader orfHeader;
if (0 == orfHeader.read(pData, 8)) {
bo = orfHeader.byteOrder();

@ -203,7 +203,7 @@ namespace Exiv2 {
img->setIptcData(iptcData_);
img->setXmpData(xmpData_);
img->writeMetadata();
int imgSize = img->io().size();
long imgSize = (long) img->io().size();
DataBuf imgBuf = img->io().read(imgSize);
#ifdef DEBUG

@ -229,7 +229,7 @@ namespace Exiv2 {
out << " address | chunk | length | data | checksum" << std::endl;
}
const long imgSize = io_->size();
const long imgSize = (long) io_->size();
DataBuf cheaderBuf(8);
while( !io_->eof() && ::strcmp(chType,"IEND") ) {
@ -390,7 +390,7 @@ namespace Exiv2 {
}
clearMetadata();
const long imgSize = io_->size();
const long imgSize = (long) io_->size();
DataBuf cheaderBuf(8); // Chunk header size : 4 bytes (data size) + 4 bytes (chunk type).
while(!io_->eof())

@ -830,7 +830,7 @@ namespace {
IptcData emptyIptc;
XmpData emptyXmp;
TiffParser::encode(mio, 0, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
return DataBuf(mio.mmap(), mio.size());
return DataBuf(mio.mmap(), (long) mio.size());
}
LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image &image, int parIdx)

@ -136,7 +136,7 @@ namespace Exiv2 {
iptcData_,
xmpData_,
io_->mmap(),
io_->size());
(uint32_t) io_->size());
setByteOrder(bo);
// A lot more metadata is hidden in the embedded preview image

@ -193,7 +193,7 @@ namespace Exiv2 {
iptcData_,
xmpData_,
io_->mmap(),
io_->size());
(uint32_t) io_->size());
setByteOrder(bo);
// read profile from the metadata
@ -219,7 +219,7 @@ namespace Exiv2 {
// Ensure that this is the correct image type
if (isTiffType(*io_, false)) {
pData = io_->mmap(true);
size = io_->size();
size = (long) io_->size();
TiffHeader tiffHeader;
if (0 == tiffHeader.read(pData, 8)) {
bo = tiffHeader.byteOrder();

Loading…
Cancel
Save