Commits

Bertrand Bordage committed 5a9fe19

Disables pad_image if it is not working for some reason on an image.

Comments (0)

Files changed (1)

cmsplugin_nivoslider/thumbnail_processors.py

     else:
         return image
 
-    # Black background
-    new_image = image.resize(new_image_size)
-    new_image.paste((0, 0, 0, 0))
+    try:
+        # Black background
+        new_image = image.resize(new_image_size)
+        new_image.paste((0, 0, 0, 0))
 
-    new_image.paste(image, (left, top))
+        new_image.paste(image, (left, top))
 
-    return new_image
+        return new_image
+    except:
+        return image