Explorar o código

Fix handling for CMYK JPEG

nagadomi %!s(int64=10) %!d(string=hai) anos
pai
achega
bbd0ff39ad
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      lib/image_loader.lua

+ 3 - 0
lib/image_loader.lua

@@ -46,6 +46,9 @@ function image_loader.decode_byte(blob)
       local alpha = nil
       
       im:fromBlob(blob, #blob)
+      if im:colorspace() == "CMYK" then
+	 im:colorspace("RGB")
+      end
       -- FIXME: How to detect that a image has an alpha channel?
       if blob:sub(1, 4) == "\x89PNG" or blob:sub(1, 3) == "GIF" then
 	 -- split alpha channel