Skip to content

Commit

Permalink
Fix broken diff printing for deep images
Browse files Browse the repository at this point in the history
  • Loading branch information
lgritz committed May 26, 2017
1 parent 1ce873b commit 942931d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/idiff/idiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,14 @@ main (int argc, char *argv[])
std::cout << ", " << img1.spec().channelnames[cr.maxc] << ')';
else
std::cout << ", channel " << cr.maxc << ')';
std::cout << " values are ";
for (int c = 0; c < img0.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img0.getchannel(cr.maxx, cr.maxy, 0, c);
std::cout << " vs ";
for (int c = 0; c < img1.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img1.getchannel(cr.maxx, cr.maxy, 0, c);
if (! img0.deep()) {
std::cout << " values are ";
for (int c = 0; c < img0.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img0.getchannel(cr.maxx, cr.maxy, 0, c);
std::cout << " vs ";
for (int c = 0; c < img1.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img1.getchannel(cr.maxx, cr.maxy, 0, c);
}
}
std::cout << "\n";
#if OIIO_MSVS_BEFORE_2015
Expand Down
14 changes: 8 additions & 6 deletions src/oiiotool/diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ OiioTool::do_action_diff (ImageRec &ir0, ImageRec &ir1,
std::cout << ", " << img1.spec().channelnames[cr.maxc] << ')';
else
std::cout << ", channel " << cr.maxc << ')';
std::cout << " values are ";
for (int c = 0; c < img0.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img0.getchannel(cr.maxx, cr.maxy, 0, c);
std::cout << " vs ";
for (int c = 0; c < img1.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img1.getchannel(cr.maxx, cr.maxy, 0, c);
if (! img0.deep()) {
std::cout << " values are ";
for (int c = 0; c < img0.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img0.getchannel(cr.maxx, cr.maxy, 0, c);
std::cout << " vs ";
for (int c = 0; c < img1.spec().nchannels; ++c)
std::cout << (c ? ", " : "") << img1.getchannel(cr.maxx, cr.maxy, 0, c);
}
}
std::cout << "\n";

Expand Down

0 comments on commit 942931d

Please sign in to comment.