Skip to content

Commit

Permalink
PNG decoder: add debug warnings for mismatched gAMA/cHRM data
Browse files Browse the repository at this point in the history
Relates to #612
  • Loading branch information
tannerhelland committed Dec 24, 2024
1 parent 5a2a662 commit 6b33e72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Classes/pdPNG.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,10 @@ Friend Function ImportStage6_PostProcessing(ByRef srcFile As String, ByRef dstDI
rgbValues(7) = CDbl(chrmData(7)) / 100000#
rgbValues(8) = 1#

If (Not gammaOK) Then gammaFloat = 1#
If (Not gammaOK) Then
If PNG_DEBUG_VERBOSE Then PDDebug.LogAction "WARNING: chromaticity present, but gamma missing; colors may be incorrect!"
gammaFloat = 1#
End If

'Our next goal is to assemble an ICC profile that matches the chromaticity and/or gamma data.
' With this, we can use our normal color-management pipeline to color-correct this DIB.
Expand Down
2 changes: 1 addition & 1 deletion PhotoDemon.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Description="PhotoDemon Photo Editor"
CompatibleMode="0"
MajorVer=2024
MinorVer=12
RevisionVer=4
RevisionVer=5
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Copyright 2000-2024 Tanner Helland - photodemon.org"
Expand Down

0 comments on commit 6b33e72

Please sign in to comment.