diff --git a/CHANGELOG.md b/CHANGELOG.md index 761bb834..b98f3b34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): ### Added - Support VFS for preset previewers that rely on external commands ([#3477]) -- Support 8-bit images in CMYK, CIELAB, and GRAY color spaces ([#3358]) +- Support 8-bit images in RGB, CIELAB, and GRAY color spaces ([#3358]) ### Fixed diff --git a/yazi-adapter/src/icc.rs b/yazi-adapter/src/icc.rs index e4e17fd7..6b3f0541 100644 --- a/yazi-adapter/src/icc.rs +++ b/yazi-adapter/src/icc.rs @@ -1,12 +1,6 @@ use anyhow::Context; -use image::{ - ColorType, DynamicImage, GrayAlphaImage, GrayImage, ImageDecoder, RgbImage, RgbaImage, - metadata::Cicp, -}; -use moxcms::{ - CicpColorPrimaries, ColorProfile, DataColorSpace, Layout, TransferCharacteristics, - TransformOptions, -}; +use image::{ColorType, DynamicImage, GrayAlphaImage, GrayImage, ImageDecoder, RgbImage, RgbaImage, metadata::Cicp}; +use moxcms::{CicpColorPrimaries, ColorProfile, DataColorSpace, Layout, TransferCharacteristics, TransformOptions}; pub(super) struct Icc; impl Icc { @@ -63,10 +57,13 @@ impl Icc { } fn requires_transform(profile: &ColorProfile) -> bool { - !(profile.color_space == DataColorSpace::Cmyk - || profile.cicp.is_some_and(|c| { - c.color_primaries == CicpColorPrimaries::Bt709 - && c.transfer_characteristics == TransferCharacteristics::Srgb - })) + if profile.color_space == DataColorSpace::Cmyk { + return false; + } + + profile.cicp.is_none_or(|c| { + c.color_primaries != CicpColorPrimaries::Bt709 + || c.transfer_characteristics != TransferCharacteristics::Srgb + }) } }