File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -310,11 +310,19 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif )
310
310
*/
311
311
if ( !cgif -> cgif_context ) {
312
312
cgif -> cgif_config .pGlobalPalette = cgif -> palette_rgb ;
313
+ #ifdef HAVE_CGIF_ATTR_NO_LOOP
314
+ cgif -> cgif_config .attrFlags = CGIF_ATTR_IS_ANIMATED | ( cgif -> loop == 1 ? CGIF_ATTR_NO_LOOP : 0 );
315
+ #else
313
316
cgif -> cgif_config .attrFlags = CGIF_ATTR_IS_ANIMATED ;
317
+ #endif /*HAVE_CGIF_ATTR_NO_LOOP*/
314
318
cgif -> cgif_config .width = frame_rect -> width ;
315
319
cgif -> cgif_config .height = frame_rect -> height ;
316
320
cgif -> cgif_config .numGlobalPaletteEntries = cgif -> lp -> count ;
321
+ #ifdef HAVE_CGIF_ATTR_NO_LOOP
322
+ cgif -> cgif_config .numLoops = cgif -> loop > 1 ? cgif -> loop - 1 : cgif -> loop ;
323
+ #else
317
324
cgif -> cgif_config .numLoops = cgif -> loop ;
325
+ #endif /*HAVE_CGIF_ATTR_NO_LOOP*/
318
326
cgif -> cgif_config .pWriteFn = vips__cgif_write ;
319
327
cgif -> cgif_config .pContext = (void * ) cgif -> target ;
320
328
Original file line number Diff line number Diff line change @@ -238,6 +238,9 @@ if quantisation_package.found()
238
238
if cgif_dep.found()
239
239
libvips_deps += cgif_dep
240
240
cfg_var.set(' HAVE_CGIF' , ' 1' )
241
+ if cc.compiles(' #include <cgif.h>\n int i = CGIF_ATTR_NO_LOOP;' , name : ' Has CGIF_ATTR_NO_LOOP' , dependencies : cgif_dep)
242
+ cfg_var.set(' HAVE_CGIF_ATTR_NO_LOOP' , ' 1' )
243
+ endif
241
244
endif
242
245
endif
243
246
You can’t perform that action at this time.
0 commit comments