From 3240856d6bd5ed83645d79a1fc12144666dbb5f5 Mon Sep 17 00:00:00 2001 From: Karl Dubost Date: Thu, 10 Mar 2016 16:15:54 +0900 Subject: [PATCH] #710 Adds parameters to save all frames for an animated GIF --- webcompat/api/uploads.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webcompat/api/uploads.py b/webcompat/api/uploads.py index 4aead0d3a..055969c9b 100644 --- a/webcompat/api/uploads.py +++ b/webcompat/api/uploads.py @@ -86,6 +86,11 @@ def save(self): # Optimize further the image compression for these formats if self.image_object.format in ['JPEG', 'JPG', 'JPE', 'PNG']: save_parameters['optimize'] = True + # If animated GIF, aka duration > 0, add save_all parameter + if (self.image_object.format == 'GIF' and + self.image_object.info['duration'] > 0): + save_parameters['save_all'] = True + # unpacking save_parameters self.image_object.save(file_dest, **save_parameters)