Skip to content

Commit

Permalink
force x/y Sampling to 1 for Deep Scanline Images
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman committed Feb 4, 2020
1 parent 0a1aa55 commit 89ce46f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions OpenEXR/IlmImf/ImfHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const
}

const std::string & part_type=hasType() ? type() : "";


if(part_type!="" && !isSupportedType(part_type))
{
Expand All @@ -882,6 +883,7 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const
return;
}

bool isDeep = isDeepData(part_type);

//
// If the file is tiled, verify that the tile description has reasonable
Expand Down Expand Up @@ -953,7 +955,8 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const
if (!isValidCompression (this->compression()))
throw IEX_NAMESPACE::ArgExc ("Unknown compression type in image header.");

if(isDeepData(part_type))

if( isDeep )
{
if (!isValidDeepCompression (this->compression()))
throw IEX_NAMESPACE::ArgExc ("Compression type in header not valid for deep data");
Expand All @@ -965,6 +968,8 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const
// If the file is tiled then for each channel, the type must be one of the
// predefined values, and the x and y sampling must both be 1.
//
// x and y sampling must currently also be 1 for deep scanline images
//
// If the file is not tiled then for each channel, the type must be one
// of the predefined values, the x and y coordinates of the data window's
// upper left corner must be divisible by the x and y subsampling factors,
Expand All @@ -974,7 +979,7 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const

const ChannelList &channels = this->channels();

if (isTiled)
if (isTiled || isDeep)
{
for (ChannelList::ConstIterator i = channels.begin();
i != channels.end();
Expand Down

0 comments on commit 89ce46f

Please sign in to comment.