From e3b71853991b3309a6b7438497876fbc10169874 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Mon, 11 Nov 2024 18:33:22 -0500 Subject: [PATCH] hioOiio: update usage of deprecated version of ImageInput::read_image() 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. --- pxr/imaging/plugin/hioOiio/oiioImage.cpp | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pxr/imaging/plugin/hioOiio/oiioImage.cpp b/pxr/imaging/plugin/hioOiio/oiioImage.cpp index 6c99dce1bc..4f82cceb60 100644 --- a/pxr/imaging/plugin/hioOiio/oiioImage.cpp +++ b/pxr/imaging/plugin/hioOiio/oiioImage.cpp @@ -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",