Skip to content

Commit

Permalink
Merge pull request #3418 from mattyjams/pr/support_OpenImageIO_3.0.0.3
Browse files Browse the repository at this point in the history
hioOiio: remove use of deprecated API to support OpenImageIO v3.0.0.3

(Internal change: 2350082)
  • Loading branch information
pixar-oss committed Dec 6, 2024
2 parents 8119bec + e3b7185 commit 4562dda
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pxr/imaging/plugin/hioOiio/oiioImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ _FindAttribute(ImageSpec const & spec, std::string const & metadataKey)
bool convertMatrixTypes = false;
std::string key = _TranslateMetadataKey(metadataKey, &convertMatrixTypes);

ImageIOParameter const * param = spec.find_attribute(key);
ParamValue const * param = spec.find_attribute(key);
if (!param) {
return VtValue();
}
Expand Down 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 4562dda

Please sign in to comment.