Fix build with vips < 8.5.0

This commit is contained in:
DarthSim
2017-10-19 22:38:09 +06:00
parent fcf964f74e
commit c052b1f2ae
2 changed files with 15 additions and 1 deletions

14
vips.h
View File

@@ -5,6 +5,9 @@
#define VIPS_SUPPORT_SMARTCROP \
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 5))
#define VIPS_SUPPORT_HASALPHA \
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 5))
#define VIPS_SUPPORT_GIF \
VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 3)
@@ -119,6 +122,17 @@ vips_band_format(VipsImage *in) {
return in->BandFmt;
}
gboolean
vips_image_hasalpha_go(VipsImage * in) {
#if VIPS_SUPPORT_HASALPHA
return vips_image_hasalpha(in);
#else
return( image->Bands == 2 ||
(image->Bands == 4 && image->Type != VIPS_INTERPRETATION_CMYK) ||
image->Bands > 4 );
#endif
}
int
vips_premultiply_go(VipsImage *in, VipsImage **out) {
return vips_premultiply(in, out, NULL);