@@ -1333,6 +1333,9 @@ pub(crate) fn choose_color_convert_func(
1333
1333
match component_count {
1334
1334
3 => match color_transform {
1335
1335
ColorTransform :: None => Ok ( color_no_convert) ,
1336
+ ColorTransform :: Grayscale => Err ( Error :: Format (
1337
+ "Invalid number of channels (3) for Grayscale data" . to_string ( ) ,
1338
+ ) ) ,
1336
1339
ColorTransform :: RGB => Ok ( color_convert_line_rgb) ,
1337
1340
ColorTransform :: YCbCr => Ok ( color_convert_line_ycbcr) ,
1338
1341
ColorTransform :: CMYK => Err ( Error :: Format (
@@ -1348,12 +1351,12 @@ pub(crate) fn choose_color_convert_func(
1348
1351
UnsupportedFeature :: ColorTransform ( ColorTransform :: JcsBgRgb ) ,
1349
1352
) ) ,
1350
1353
ColorTransform :: Unknown => Err ( Error :: Format ( "Unknown colour transform" . to_string ( ) ) ) ,
1351
- ColorTransform :: Grayscale => Err ( Error :: Unsupported (
1352
- UnsupportedFeature :: ColorTransform ( ColorTransform :: Grayscale ) ,
1353
- ) ) ,
1354
1354
} ,
1355
1355
4 => match color_transform {
1356
1356
ColorTransform :: None => Ok ( color_no_convert) ,
1357
+ ColorTransform :: Grayscale => Err ( Error :: Format (
1358
+ "Invalid number of channels (4) for Grayscale data" . to_string ( ) ,
1359
+ ) ) ,
1357
1360
ColorTransform :: RGB => Err ( Error :: Format (
1358
1361
"Invalid number of channels (4) for RGB data" . to_string ( ) ,
1359
1362
) ) ,
@@ -1370,9 +1373,6 @@ pub(crate) fn choose_color_convert_func(
1370
1373
UnsupportedFeature :: ColorTransform ( ColorTransform :: JcsBgRgb ) ,
1371
1374
) ) ,
1372
1375
ColorTransform :: Unknown => Err ( Error :: Format ( "Unknown colour transform" . to_string ( ) ) ) ,
1373
- ColorTransform :: Grayscale => Err ( Error :: Unsupported (
1374
- UnsupportedFeature :: ColorTransform ( ColorTransform :: Grayscale ) ,
1375
- ) ) ,
1376
1376
} ,
1377
1377
_ => panic ! ( ) ,
1378
1378
}
0 commit comments