Skip to content

Commit

Permalink
hioOiio: update usage of deprecated version of ImageInput::read_image()
Browse files Browse the repository at this point in the history
As of OpenImageIO v3.0.0.3, a set of deprecated overloads of
ImageInput::read_image() were removed. This change unrolls
the overload that was being used into its equivalent in the
current API, which was also available in OpenImageIO 2.x.
  • Loading branch information
mattyjams committed Nov 22, 2024
1 parent 29d955f commit e3b7185
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions pxr/imaging/plugin/hioOiio/oiioImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,21 +711,21 @@ HioOIIO_Image::ReadCropped(int const cropTop,
// Read Image into pixels, flipping upon load so that
// origin is at lower left corner
// If needed, convert double precision images to float
bool res = false;
if (imageInput->spec().format == TypeDesc::DOUBLE) {
res = imageInput->read_image(TypeDesc::FLOAT,
start,
AutoStride,
readStride,
AutoStride);
} else{
res = imageInput->read_image(imageInput->spec().format,
start,
AutoStride,
readStride,
AutoStride);
}

TypeDesc format = imageInput->spec().format;
if (format == TypeDesc::DOUBLE) {
format = TypeDesc::FLOAT;
}

bool res = imageInput->read_image(
imageInput->current_subimage(),
imageInput->current_miplevel(),
0,
-1,
format,
start,
AutoStride,
readStride,
AutoStride);
if (!res)
{
TF_RUNTIME_ERROR("Failed to read image pixel from \"%s\", error = %s",
Expand Down

0 comments on commit e3b7185

Please sign in to comment.