1
0
Fork 0
mirror of synced 2024-06-14 17:04:31 +12:00

Fix handling for CMYK JPEG

This commit is contained in:
nagadomi 2015-11-03 23:20:21 +09:00
parent ee19e2608e
commit bbd0ff39ad

View file

@ -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