Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
modify log message
Browse files Browse the repository at this point in the history
  • Loading branch information
zhreshold committed Sep 21, 2017
1 parent 715759e commit 31213c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/io/image_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void ImdecodeImpl(int flag, bool to_rgb, void* data, size_t size,
if (out->is_none()) {
cv::Mat res = cv::imdecode(buf, flag);
if (res.empty()) {
LOG(INFO) << "Invalid image file. Only supports png and jpg.";
LOG(INFO) << "Decoding failed. Invalid image file.";
*out = NDArray();
return;
}
Expand All @@ -157,10 +157,10 @@ void ImdecodeImpl(int flag, bool to_rgb, void* data, size_t size,
out->data().dptr_);
#if (CV_MAJOR_VERSION > 2 || (CV_MAJOR_VERSION == 2 && CV_MINOR_VERSION >=4))
cv::imdecode(buf, flag, &dst);
CHECK(!dst.empty()) << "Failed decoding image to output directly.";
CHECK(!dst.empty()) << "Decoding failed. Invalid image file.";
#else
cv::Mat tmp = cv::imdecode(buf, flag);
CHECK(!tmp.empty()) << "Invalid image file. Only supports png and jpg.";
CHECK(!tmp.empty()) << "Decoding failed. Invalid image file.";
tmp.copyTo(dst);
CHECK(!dst.empty()) << "Failed copying buffer to output.";
#endif
Expand Down

0 comments on commit 31213c8

Please sign in to comment.