Skip to content

Commit

Permalink
logging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jstkdng committed Aug 7, 2023
1 parent 212ad6c commit 31c83e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ auto Image::load(const njson& command, const Terminal& terminal) -> std::unique_
} catch (const std::runtime_error& ex) {}
}
#endif
if (vips_foreign_find_load(image_path.c_str()) != nullptr) {
const auto* vips_loader = vips_foreign_find_load(image_path.c_str());
if (vips_loader != nullptr) {
try {
return std::make_unique<LibvipsImage>(dimensions, image_path, in_cache);
} catch (const vips::VError& err) {}
Expand Down
5 changes: 3 additions & 2 deletions src/image/opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ max_width(dims->max_wpixels()),
max_height(dims->max_hpixels()),
in_cache(in_cache)
{
logger = spdlog::get("opencv");
image = cv::imread(filename, cv::IMREAD_UNCHANGED);
if (image.empty()) {
throw std::runtime_error("OpenCV unable to read image");
logger->warn("unable to read image");
throw std::runtime_error("");
}
logger = spdlog::get("opencv");
logger->info("Loading image {}", filename);
flags = Flags::instance();

Expand Down

0 comments on commit 31c83e0

Please sign in to comment.