Code review fix for PNG Auxiliary (#643)

This commit is contained in:
Chuck Walbourn 2025-10-28 14:10:07 -07:00 committed by GitHub
parent c027648890
commit 232bbf2e39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,7 +164,7 @@ namespace
if( png_get_gAMA( st, info, &gamma ) ) if( png_get_gAMA( st, info, &gamma ) )
{ {
// If gamma == 1.0, then the data is internally linear. // If gamma == 1.0, then the data is internally linear.
if( abs( gamma - 1.0 ) > 1e6 ) if( abs( gamma - 1.0 ) > 1e-6 )
png_set_gamma( st, screen_gamma, gamma ); png_set_gamma( st, screen_gamma, gamma );
} }
} }
@ -216,7 +216,7 @@ namespace
if( png_get_gAMA( st, info, &gamma ) ) if( png_get_gAMA( st, info, &gamma ) )
{ {
// This PNG is explicitly linear. // This PNG is explicitly linear.
if( abs( gamma - 1.0 ) <= 1e6 ) if( abs( gamma - 1.0 ) <= 1e-6 )
return linear; return linear;
} }
} }