File: drop_JpegIPTC_support.patch

package info (click to toggle)
thumbor 7.7.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,556 kB
  • sloc: xml: 295,435; python: 18,673; ansic: 1,479; makefile: 360; sh: 27
file content (77 lines) | stat: -rw-r--r-- 2,401 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Description: Drop support for JpegIPTC due to upstream maintenance issue
  Details at https://github.com/gdegoulet/JpegIPTC/issues/8
Author: Marcelo Jorge Vieira <metal@debian.org>
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/setup.py
+++ b/setup.py
@@ -148,7 +148,6 @@
         install_requires=[
             "colorama==0.*,>=0.4.6",
             "derpconf==0.*,>=0.8.4",
-            "JpegIPTC==1.*,>=1.5",
             "libthumbor==2.*,>=2.0.2",
             "piexif==1.*,>=1.1.3",
             "Pillow>=10.4.0,<11.0.0",
--- a/thumbor/config.py
+++ b/thumbor/config.py
@@ -284,13 +284,6 @@
 )
 
 Config.define(
-    "PRESERVE_IPTC_INFO",
-    False,
-    "Preserves Jpeg IPTC information in generated images.",
-    "Imaging",
-)
-
-Config.define(
     "ALLOW_ANIMATED_GIFS",
     True,
     "Indicates whether thumbor should enable the EXPERIMENTAL support for animated gifs.",
--- a/thumbor/engines/pil.py
+++ b/thumbor/engines/pil.py
@@ -10,7 +10,6 @@
 from io import BytesIO
 
 import piexif
-from JpegIPTC import JpegIPTC
 from PIL import Image, ImageDraw, ImageFile, ImageSequence, JpegImagePlugin
 from PIL import features as pillow_features
 
@@ -76,7 +75,6 @@
         self.qtables = None
         self.original_mode = None
         self.exif = None
-        self.iptc = None
 
         try:
             if self.context.config.MAX_PIXELS is None or int(
@@ -110,11 +108,6 @@
         self.exif = img.info.get("exif")
         self.original_mode = img.mode
 
-        if self.context.config.PRESERVE_IPTC_INFO:
-            jpegiptc_object = JpegIPTC()
-            jpegiptc_object.load_from_binarydata(buffer)
-            self.iptc = jpegiptc_object.get_raw_iptc()
-
         if hasattr(img, "layer"):
             self.subsampling = JpegImagePlugin.get_sampling(img)
             if self.subsampling == -1:  # n/a for this file
@@ -436,14 +429,6 @@
         img_buffer.close()
         self.extension = ext
 
-        if self.context.config.PRESERVE_IPTC_INFO:
-            jpegiptc_object_d = JpegIPTC()
-            jpegiptc_object_d.load_from_binarydata(results)
-            jpegiptc_object_d.set_raw_iptc(self.iptc)
-            newresults = jpegiptc_object_d.dump()
-            if newresults is not None:
-                results = newresults
-
         return results
 
     def read_multiple(self, images, extension=None):