Skip to content

Conversation

@Etienne-Gautier
Copy link
Contributor

Context

I saw some files (as the one added in the test corpus), where the color Klass doesn't match the color-mode of the PSD file. Specifically I've seen HSB colors in files with RGB and CMYK color modes.

These types of colors seem to come from other softwares (Affinity Designer) as Photoshop itself seems to always convert the HSB values to match the color mode of the file when saving. However Photoshop supports opening files with HSB color when the color mode RGB or CMYK (I haven't had the opportunity to test with other color modes).

Copy link
Contributor

@kyamagu kyamagu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this issue. My only question is about the necessity of always passing the entire low-level PSD structure, as it seems only the target color mode matters in the end. I understand that the function signature must be uniform in _get_xxx.



def _get_color(desc) -> Tuple[float, ...]:
def _get_color(psd, desc) -> Tuple[float, ...]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really necessary to always pass the entire PSD structure or only the color mode property?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the color_mode only is sufficient. I've update the code

@Etienne-Gautier Etienne-Gautier requested a review from kyamagu June 21, 2023 04:59
Copy link
Contributor

@kyamagu kyamagu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants