Skip to content

Commit

Permalink
Combined conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 24, 2024
1 parent 41270f3 commit 97cea28
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/_imagingcms.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,32 +213,31 @@ cms_transform_dealloc(CmsTransformObject *self) {

static cmsUInt32Number
findLCMStype(char *PILmode) {
if (strcmp(PILmode, "RGB") == 0) {
return TYPE_RGBA_8;
} else if (strcmp(PILmode, "RGBA") == 0) {
return TYPE_RGBA_8;
} else if (strcmp(PILmode, "RGBX") == 0) {
if (
strcmp(PILmode, "RGB") == 0 ||
strcmp(PILmode, "RGBA") == 0 ||
strcmp(PILmode, "RGBX") == 0
) {
return TYPE_RGBA_8;
} else if (strcmp(PILmode, "RGBA;16B") == 0) {
return TYPE_RGBA_16;
} else if (strcmp(PILmode, "CMYK") == 0) {
return TYPE_CMYK_8;
} else if (strcmp(PILmode, "L") == 0) {
return TYPE_GRAY_8;
} else if (strcmp(PILmode, "L;16") == 0) {
return TYPE_GRAY_16;
} else if (strcmp(PILmode, "L;16B") == 0) {
return TYPE_GRAY_16_SE;
} else if (strcmp(PILmode, "YCCA") == 0) {
return TYPE_YCbCr_8;
} else if (strcmp(PILmode, "YCC") == 0) {
} else if (
strcmp(PILmode, "YCCA") == 0 ||
strcmp(PILmode, "YCC") == 0
) {
return TYPE_YCbCr_8;
} else if (strcmp(PILmode, "LAB") == 0) {
// LabX equivalent like ALab, but not reversed -- no #define in lcms2
return (COLORSPACE_SH(PT_LabV2) | CHANNELS_SH(3) | BYTES_SH(1) | EXTRA_SH(1));
}
else {
/* take a wild guess... */
/* presume "L" by default */
return TYPE_GRAY_8;
}
}
Expand Down

0 comments on commit 97cea28

Please sign in to comment.