Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 9db1e66

Browse files
authored
Merge pull request #8 from alicevision/dev_srgb
Convert to sRGB when it is not already the case
2 parents b2249f9 + 5bb5d71 commit 9db1e66

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '1.0.{build}'
22

3-
image: Visual Studio 2015
3+
image: Visual Studio 2017
44

55
configuration:
66
- Release
@@ -9,7 +9,7 @@ platform:
99
- x64
1010

1111
environment:
12-
QT5: C:\Qt\5.11.1\msvc2015_64
12+
QT5: C:\Qt\5.11.2\msvc2017_64
1313
# APPVEYOR_SAVE_CACHE_ON_ERROR: true
1414

1515
install:
@@ -37,4 +37,4 @@ build:
3737

3838
cache:
3939
c:\tools\vcpkg\installed\
40-
40+

src/imageIOHandler/QtOIIOHandler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ bool QtOIIOHandler::read(QImage *image)
8282

8383
qDebug() << "[QtOIIO] width:" << inSpec.width << ", height:" << inSpec.height << ", nchannels:" << inSpec.nchannels;
8484

85+
if(inSpec.nchannels >= 3)
86+
{
87+
// Color conversion to sRGB
88+
const std::string& colorSpace = inSpec.get_string_attribute("oiio:Colorspace", "sRGB");
89+
if(colorSpace != "sRGB")
90+
oiio::ImageBufAlgo::colorconvert(inBuf, inBuf, colorSpace, "sRGB");
91+
}
92+
8593
int nchannels = 0;
8694
QImage::Format format = QImage::NImageFormats;
8795
if(inSpec.nchannels == 4)

0 commit comments

Comments
 (0)