Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/doc/stdmetadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ Display hints
3 rotated :math:`180^\circ` (bottom to top, right to left)
4 flipped vertically (bottom to top, left to right)
5 transposed (left to right, top to bottom)
6 rotated :math:`90^\circ` clockwise (right to left, top to bottom)
6 rotated :math:`90^\circ` counter-clockwise (right to left, top to bottom)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this description is correct?

If this is default orientation 1:

    0--->
    1--->
    2--->

and this is orientation 6, rows right to left and columns top to bottom:

   2 1 0
   | | |
   v v v

Wouldn't you say that the second pattern is rotated clockwise from the default?

7 transverse (right to left, bottom to top)
8 rotated :math:`90^\circ` counter-clockwise (left to right, bottom to top)
8 rotated :math:`90^\circ` clockwise (left to right, bottom to top)
=== ==========================================================================

.. option:: "PixelAspectRatio" : float
Expand Down
4 changes: 2 additions & 2 deletions src/libOpenImageIO/imagebufalgo_orient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,15 @@ ImageBufAlgo::reorient(ImageBuf& dst, const ImageBuf& src, int nthreads)
case 3: ok = ImageBufAlgo::rotate180(dst, src, ROI(), nthreads); break;
case 4: ok = ImageBufAlgo::flip(dst, src, ROI(), nthreads); break;
case 5:
ok = ImageBufAlgo::rotate270(tmp, src, ROI(), nthreads);
ok = ImageBufAlgo::rotate90(tmp, src, ROI(), nthreads);
if (ok)
ok = ImageBufAlgo::flop(dst, tmp, ROI(), nthreads);
else
dst.errorfmt("{}", tmp.geterror());
break;
case 6: ok = ImageBufAlgo::rotate90(dst, src, ROI(), nthreads); break;
case 7:
ok = ImageBufAlgo::flip(tmp, src, ROI(), nthreads);
ok = ImageBufAlgo::flop(tmp, src, ROI(), nthreads);
if (ok)
ok = ImageBufAlgo::rotate90(dst, tmp, ROI(), nthreads);
else
Expand Down
Loading