From 3b05038c8ad3d5854e094c19494e6fa0be70d82a Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Thu, 20 Aug 2026 13:35:59 -0700 Subject: [PATCH 1/2] ImageReader, TextureLoader : Remove special case for png colorspaces OIIO 3 doesn't have "linear" built-in anymore, and it now needs to come from the config. This is causing errors when trying to open png files, as often there isn't a colorspace specifically called "linear". The original reasons for hard-coding that colorspace don't seem to apply anymore, neither ImageEngine nor gaffer are loading UI icons that way, so it seems reasonable to remove it, and treat png files just like any other image. --- Changes | 5 +++++ src/IECoreGL/TextureLoader.cpp | 24 ++++-------------------- src/IECoreImage/ImageReader.cpp | 20 ++------------------ 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/Changes b/Changes index be7aed4d20..0eaa36faf3 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,11 @@ Improvements - PrimitiveVariable : Added `format_as` overload for `Interpolation`, so that it can be passed to `fmt::format()`. - AlembicScene : Added support for reading `P3d` and `N3d` GeomParams. +Fixes +----- + +- ImageReader, TextureLoader : Removed special case for colorspaces when opening pngs. + Build ----- diff --git a/src/IECoreGL/TextureLoader.cpp b/src/IECoreGL/TextureLoader.cpp index df719176b9..aeeb4d5059 100644 --- a/src/IECoreGL/TextureLoader.cpp +++ b/src/IECoreGL/TextureLoader.cpp @@ -145,30 +145,14 @@ TexturePtr TextureLoader::load( const std::string &name, int maximumResolution ) } // This logic feels pretty broken - why do we ask the current color config's - // display transform to decide what colorspace a file is stored in? Why special - // case just png. But I've currently copied this logic from ImageReader in the + // display transform to decide what colorspace a file is stored in? + // But I've currently copied this logic from ImageReader in the // name of backwards compatibility std::string linearColorSpace; std::string currentColorSpace; OIIO::string_view fileFormat = imageBuf.file_format_name(); - if( fileFormat == "png" ) - { - // The most common use for loading PNGs via Cortex is for icons in Gaffer. - // If we were to use the OCIO config to guess the colorspaces as below, we - // would get it spectacularly wrong. For instance, with an ACES config the - // resulting icons are so washed out as to be illegible. Instead, we hardcode - // the rudimentary colour spaces much more likely to be associated with a PNG. - // These are supported by OIIO regardless of what OCIO config is in use. - /// \todo Should this apply to other formats too? Can we somehow fix - /// `OpenImageIOAlgo::colorSpace` instead? - linearColorSpace = "linear"; - currentColorSpace = "sRGB"; - } - else - { - linearColorSpace = IECoreImage::OpenImageIOAlgo::colorSpace( "", imageBuf.spec() ); - currentColorSpace = IECoreImage::OpenImageIOAlgo::colorSpace( fileFormat, imageBuf.spec() ); - } + linearColorSpace = IECoreImage::OpenImageIOAlgo::colorSpace( "", imageBuf.spec() ); + currentColorSpace = IECoreImage::OpenImageIOAlgo::colorSpace( fileFormat, imageBuf.spec() ); if( !OIIO::ImageBufAlgo::colorconvert( imageBuf, imageBuf, currentColorSpace, linearColorSpace ) ) { diff --git a/src/IECoreImage/ImageReader.cpp b/src/IECoreImage/ImageReader.cpp index 49dad2f9f3..0fd51dbb51 100644 --- a/src/IECoreImage/ImageReader.cpp +++ b/src/IECoreImage/ImageReader.cpp @@ -479,24 +479,8 @@ class ImageReader::Implementation OIIO::TypeString, &fileFormat ); - if( strcmp( fileFormat, "png" ) == 0 ) - { - // The most common use for loading PNGs via Cortex is for icons in Gaffer. - // If we were to use the OCIO config to guess the colorspaces as below, we - // would get it spectacularly wrong. For instance, with an ACES config the - // resulting icons are so washed out as to be illegible. Instead, we hardcode - // the rudimentary colour spaces much more likely to be associated with a PNG. - // These are supported by OIIO regardless of what OCIO config is in use. - /// \todo Should this apply to other formats too? Can we somehow fix - /// `OpenImageIOAlgo::colorSpace` instead? - m_linearColorSpace = "linear"; - m_currentColorSpace = "sRGB"; - } - else - { - m_linearColorSpace = OpenImageIOAlgo::colorSpace( "", *spec ); - m_currentColorSpace = OpenImageIOAlgo::colorSpace( fileFormat, *spec ); - } + m_linearColorSpace = OpenImageIOAlgo::colorSpace( "", *spec ); + m_currentColorSpace = OpenImageIOAlgo::colorSpace( fileFormat, *spec ); return true; } From def59fa2fca4f76003630e10a1c8a241b3a078ea Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Fri, 28 Aug 2026 09:45:58 -0700 Subject: [PATCH 2/2] SConstruct : Bump version to 10.7.1.1 --- Changes | 13 +++++++------ SConstruct | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 0eaa36faf3..7287706651 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,13 @@ -10.7.x.x (relative to 10.7.1.0) +10.7.x.x (relative to 10.7.1.1) ======== +10.7.1.1 (relative to 10.7.1.0) +======== +Fixes +----- + +- ImageReader, TextureLoader : Removed special case for colorspaces when opening pngs. 10.7.1.0 (relative to 10.7.0.0) ======== @@ -14,11 +20,6 @@ Improvements - PrimitiveVariable : Added `format_as` overload for `Interpolation`, so that it can be passed to `fmt::format()`. - AlembicScene : Added support for reading `P3d` and `N3d` GeomParams. -Fixes ------ - -- ImageReader, TextureLoader : Removed special case for colorspaces when opening pngs. - Build ----- diff --git a/SConstruct b/SConstruct index 6f4bd33a79..3c87d37c69 100644 --- a/SConstruct +++ b/SConstruct @@ -54,7 +54,7 @@ SConsignFile() ieCoreMilestoneVersion = 10 # for announcing major milestones - may contain all of the below ieCoreMajorVersion = 7 # backwards-incompatible changes ieCoreMinorVersion = 1 # new backwards-compatible features -ieCorePatchVersion = 0 # bug fixes +ieCorePatchVersion = 1 # bug fixes ieCoreVersionSuffix = "" # used for alpha/beta releases. Example: "a1", "b2", etc. ###########################################################################################