Permalink
Browse files

Fix for issue #354

  • Loading branch information...
1 parent fe35394 commit 385e0b32ad8e61c5ed752106b3ea03f9c045f508 @jenche committed May 15, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/dpx.imageio/dpxoutput.cpp
  2. +1 −1 src/dpx.imageio/libdpx/Writer.cpp
  3. +1 −1 src/dpx.imageio/libdpx/WriterInternal.h
@@ -180,8 +180,8 @@ DPXOutput::open (const std::string &name, const ImageSpec &userspec,
// check if the client wants endianness reverse to native
// assume big endian per Jeremy's request, unless little endian is
// explicitly specified
- std::string tmpstr = m_spec.get_string_attribute ("oiio:Endian", "big");
- m_wantSwap = (littleendian() != Strutil::iequals (tmpstr, "little"));
+ std::string tmpstr = m_spec.get_string_attribute ("oiio:Endian", littleendian() ? "little" : "big");
+ m_wantSwap = (littleendian() != Strutil::iequals (tmpstr, "little"));
m_dpx.SetOutStream (m_stream);
@@ -262,7 +262,7 @@ bool dpx::Writer::WriteElement(const int element, void *data, const DataSize siz
}
// can we write the entire memory chunk at once without any additional processing
- if (!rle &&
+ if (!rle && !this->header.RequiresByteSwap() &&
((bitDepth == 8 && size == dpx::kByte) ||
(bitDepth == 12 && size == dpx::kWord && packing == kFilledMethodA) ||
(bitDepth == 16 && size == dpx::kWord) ||
@@ -286,7 +286,7 @@ namespace dpx
const int bytes = Header::DataSizeByteCount(src_size);
// copy buffer if need to promote data types from src to destination
- if (!SAMEBUFTYPE)
+ if (SAMEBUFTYPE)
{
src = dst;
CopyWriteBuffer<IB>(src_size, (imageBuf+(h*width*noc*bytes)+(h*eolnPad)), dst, (width*noc));

0 comments on commit 385e0b3

Please sign in to comment.