Switch to libvips' recently-exposed has_alpha #2569

This commit is contained in:
Lovell Fuller
2021-02-22 12:32:20 +00:00
parent 9f2f92095d
commit cc37b59309
2 changed files with 4 additions and 6 deletions

View File

@@ -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();
}
/*