Package: sorl-thumbnail / 12.5.0-1

workaround-pgmagick-exception.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: workaround an exception with newer pgmagick version
Author: W. Martin Borgert <debacle@debian.org>
Origin: vendor
Bug: https://github.com/jazzband/sorl-thumbnail/issues/558
Bug-Debian: https://bugs.debian.org/902522
Last-Update: 2018-08-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/sorl/thumbnail/engines/pgmagick_engine.py
+++ b/sorl/thumbnail/engines/pgmagick_engine.py
@@ -26,7 +26,10 @@
     def is_valid_image(self, raw_data):
         blob = Blob()
         blob.update(raw_data)
-        im = Image(blob)
+        try:
+            im = Image(blob)
+        except RuntimeError:
+            return False
         return im.isValid()
 
     def _cropbox(self, image, x, y, x2, y2):