Better animation detection

This commit is contained in:
DarthSim
2022-06-10 15:27:15 +06:00
parent 1de96252ed
commit 8a536d69a3
2 changed files with 48 additions and 44 deletions

View File

@@ -139,9 +139,14 @@ vips_band_format(VipsImage *in) {
gboolean
vips_is_animated(VipsImage * in) {
return( vips_image_get_typeof(in, "page-height") != G_TYPE_INVALID &&
vips_image_get_typeof(in, "gif-delay") != G_TYPE_INVALID &&
vips_image_get_typeof(in, "gif-loop") != G_TYPE_INVALID );
int n_pages;
return( vips_image_get_typeof(in, "delay") != G_TYPE_INVALID &&
vips_image_get_typeof(in, "loop") != G_TYPE_INVALID &&
vips_image_get_typeof(in, "page-height") == G_TYPE_INT &&
vips_image_get_typeof(in, "n-pages") == G_TYPE_INT &&
vips_image_get_int(in, "n-pages", &n_pages) == 0 &&
n_pages > 1 );
}
int