mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Switch to libvips' recently-exposed has_alpha #2569
This commit is contained in:
@@ -421,12 +421,7 @@ namespace sharp {
|
||||
Uses colour space interpretation with number of channels to guess this.
|
||||
*/
|
||||
bool HasAlpha(VImage image) {
|
||||
int const bands = image.bands();
|
||||
VipsInterpretation const interpretation = image.interpretation();
|
||||
return (
|
||||
(bands == 2 && interpretation == VIPS_INTERPRETATION_B_W) ||
|
||||
(bands == 4 && interpretation != VIPS_INTERPRETATION_CMYK) ||
|
||||
(bands == 5 && interpretation == VIPS_INTERPRETATION_CMYK));
|
||||
return image.has_alpha();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user