Skip to content

Commit

Permalink
remove some get() calls
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Feb 12, 2025
1 parent f9fc1f8 commit 8983e6a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,7 @@ bool readImage(const char* path, Options& /* options */) {
bool bResult = false;

try {
Image::UniquePtr image = ImageFactory::open(path);
if (image.get()) {
if (auto image = ImageFactory::open(path)) {
image->readMetadata();
ExifData& exifData = image->exifData();
bResult = !exifData.empty();
Expand Down Expand Up @@ -848,8 +847,7 @@ int main(int argc, const char* argv[]) {
try {
time_t t = readImageTime(path, &stamp);
Position* pPos = searchTimeDict(gTimeDict, t, Position::deltaMax_);
Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(path);
if (image.get()) {
if (auto image = Exiv2::ImageFactory::open(path)) {
image->readMetadata();
Exiv2::ExifData& exifData = image->exifData();
if (pPos) {
Expand Down

0 comments on commit 8983e6a

Please sign in to comment.