Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/imageio/PngImageLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ Task<vector<ImageData>> PngImageLoader::load(istream& iStream, const fs::path&,
resultData.nativeMetadata.chroma = rec709Chroma(); // default to Rec.709 primaries unless cHRM chunk says otherwise

int srgbIntent = 0;
const bool hasChunkSrgb = png_get_sRGB(pngPtr, infoPtr, &srgbIntent) == PNG_INFO_iCCP;
const bool hasChunkSrgb = png_get_sRGB(pngPtr, infoPtr, &srgbIntent) == PNG_INFO_sRGB;

double invGamma64 = 1.0 / 2.2;
const bool hasChunkGama = png_get_gAMA(pngPtr, infoPtr, &invGamma64) == PNG_INFO_gAMA;
Expand Down
2 changes: 2 additions & 0 deletions src/imageio/PngImageSaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Task<void> PngImageSaver::save(ostream& oStream, const fs::path&, span<const uin
png, info, imageSize.x(), imageSize.y(), 8, colorType, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT
);

png_set_sRGB(png, info, 3 /* absolute colorimetric */);

png_write_info(png, info);

const auto stride = (size_t)imageSize.x() * nChannels;
Expand Down
Loading