Skip to content

Commit 2b74cc8

Browse files
committed
Revert some boilerplate which is not needed
1 parent d4ffcb9 commit 2b74cc8

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/bmffimage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ void BmffImage::printStructure(std::ostream& out, Exiv2::PrintStructureOption op
620620
break; // do nothing
621621

622622
case kpsIccProfile: {
623-
out.write(iccProfile_.empty() ? nullptr : iccProfile_.c_str(), iccProfile_.size());
623+
out.write(iccProfile_.c_str(), iccProfile_.size());
624624
} break;
625625

626626
#ifdef EXV_HAVE_XMP_TOOLKIT

src/jpgimage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
746746
bo = littleEndian;
747747
setByteOrder(bo);
748748
}
749-
const byte* pExifData = rawExif.empty() ? nullptr : rawExif.c_data();
749+
const byte* pExifData = rawExif.c_data();
750750
size_t exifSize = rawExif.size();
751751
WriteMethod wm = ExifParser::encode(blob, pExifData, exifSize, bo, exifData_);
752752
if (wm == wmIntrusive) {
@@ -843,7 +843,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
843843
if (foundCompletePsData || iptcData_.count() > 0) {
844844
// Set the new IPTC IRB, keeps existing IRBs but removes the
845845
// IPTC block if there is no new IPTC data to write
846-
DataBuf newPsData = Photoshop::setIptcIrb(!psBlob.empty() ? psBlob.data() : nullptr, psBlob.size(), iptcData_);
846+
DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
847847
const long maxChunkSize = 0xffff - 16;
848848
const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
849849
const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);

src/rafimage.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ void RafImage::readMetadata() {
265265
throw Error(ErrorCode::kerFailedToReadImageData);
266266
}
267267

268-
// io_->seek(0, BasicIo::beg); // rewind
269-
270-
ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.empty() ? nullptr : buf.c_data(), buf.size());
268+
ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.c_data(), buf.size());
271269

272270
exifData_["Exif.Image2.JPEGInterchangeFormat"] = getULong(jpg_img_offset, bigEndian);
273271
exifData_["Exif.Image2.JPEGInterchangeFormatLength"] = getULong(jpg_img_length, bigEndian);

0 commit comments

Comments
 (0)