Explorar o código

Fix colorspace/representation values to display e.g "sRGB" and not "1"

Ruben %!s(int64=4) %!d(string=hai) anos
pai
achega
c7b5f7c30c
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      PicView/ImageHandling/GetImageData.cs

+ 7 - 1
PicView/ImageHandling/GetImageData.cs

@@ -555,7 +555,13 @@ namespace PicView.ImageHandling
                 var colorSpace = exifData.GetValue(ExifTag.ColorSpace);
                 if (colorSpace is not null)
                 {
-                    colorRepresentationValue = colorSpace.Value.ToString();
+                    switch (colorSpace.Value)
+                    {
+                        case 1: colorRepresentationValue = "sRGB"; break;
+                        case 2: colorRepresentationValue = "Adobe RGB"; break;
+                        case 65535: colorRepresentationValue = "Uncalibrated"; break;
+                        default: colorRepresentationValue = "Unknown"; break;
+                    }
                 }
 
                 var compr = exifData.GetValue(ExifTag.Compression);