py-img-processor 1.2.2__py3-none-any.whl → 1.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
imgprocessor/__init__.py CHANGED
@@ -5,7 +5,7 @@ import importlib
5
5
 
6
6
 
7
7
  __all__ = ["settings", "VERSION"]
8
- __version__ = "1.2.2"
8
+ __version__ = "1.2.3"
9
9
 
10
10
 
11
11
  VERSION = __version__
@@ -90,7 +90,7 @@ class MergeParser(BaseParser):
90
90
  raise ParamValidateException(f"merage操作中actions参数校验异常,其中 {e}")
91
91
 
92
92
  def compute(self, src_w: int, src_h: int, w2: int, h2: int) -> tuple:
93
- if self.order in enums.PositionOrder.values:
93
+ if self.order in enums.PositionOrder:
94
94
  order = typing.cast(int, self.order)
95
95
  w, h, x1, y1, x2, y2 = compute_splice_two_im(
96
96
  src_w,
imgprocessor/processor.py CHANGED
@@ -51,13 +51,12 @@ class ProcessorCtr(object):
51
51
  **kwargs: typing.Any,
52
52
  ) -> typing.Optional[typing.ByteString]:
53
53
  fmt = kwargs.get("format") or im.format
54
- kwargs["format"] = fmt
55
54
 
56
- if fmt.upper() == enums.ImageFormat.JPEG.value and im.mode == "RGBA":
55
+ if fmt and fmt.upper() == enums.ImageFormat.JPEG.value and im.mode == "RGBA":
57
56
  im = im.convert("RGB")
58
57
 
59
58
  if not kwargs.get("quality"):
60
- if fmt.upper() == enums.ImageFormat.JPEG.value and im.format == enums.ImageFormat.JPEG.value:
59
+ if fmt and fmt.upper() == enums.ImageFormat.JPEG.value and im.format == enums.ImageFormat.JPEG.value:
61
60
  kwargs["quality"] = "keep"
62
61
  else:
63
62
  kwargs["quality"] = settings.PROCESSOR_DEFAULT_QUALITY
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-img-processor
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: Image editor using Python and Pillow.
5
5
  Home-page: https://github.com/SkylerHu/py-img-processor.git
6
6
  Author: SkylerHu
@@ -1,8 +1,8 @@
1
- imgprocessor/__init__.py,sha256=fcX589VMaXhJoh0DS2UxXIjyaBrhMBc21yBNtsOgJwo,2485
1
+ imgprocessor/__init__.py,sha256=MRxiDm197O7yKi84nRtUSDP1NvjN5FhzFgtJB8j4-fA,2485
2
2
  imgprocessor/enums.py,sha256=uionzxbpytnM1iWPTj2Imh6v20kOhGy1i2HPsH-J14U,3129
3
3
  imgprocessor/exceptions.py,sha256=kj9win_XjCbZnXr93sYs4Cfg1hAJX2fn5hgr1YMNoHQ,384
4
4
  imgprocessor/main.py,sha256=WDRsVtHNqlsngZHVZHuY0IE93OsXC5XD1fL-Zbw0KDs,4117
5
- imgprocessor/processor.py,sha256=Lqtat8-LeG65H8R55mA7GlDjmDec3Hb-uhJ4PRSf40s,4570
5
+ imgprocessor/processor.py,sha256=VEZfDSDtJb5F8XbaFli234GKt50D1JUDGzPGkzugqDM,4555
6
6
  imgprocessor/utils.py,sha256=KBRQJaN8FuuRD2QQPYuuHQ7S-2ML-ctz4rstQTrEdog,1202
7
7
  imgprocessor/parsers/__init__.py,sha256=J3KQGgqUerzcnXihIcy7l0Z5JF8UjlVLqVEDEigPS8I,2937
8
8
  imgprocessor/parsers/alpha.py,sha256=PudXZBu-s5Fzj6fB7Aae4yxJkmdfd_l_oAFSk7279Zk,877
@@ -11,13 +11,13 @@ imgprocessor/parsers/blur.py,sha256=twVLORVV4nXfvHBaqi353X6odOnRi414sye3AOGG5bY,
11
11
  imgprocessor/parsers/circle.py,sha256=VXWgKIkz9emQHWOoO2jbkUFrEbXb1s6ZM-R8BRxSi4c,1665
12
12
  imgprocessor/parsers/crop.py,sha256=FfPPmN63XUQZCgRkKuuycj9SLdS-0hnLAU5mRrj-4Uc,3524
13
13
  imgprocessor/parsers/gray.py,sha256=qMPid9X2tJko3pt5O-RNpXBR5drTowwOHTlfEFksiuQ,402
14
- imgprocessor/parsers/merge.py,sha256=bzvO-rKQ0K_d8dQtjjTiH_jH7Mu7kjvOr2gY59NsJuw,5218
14
+ imgprocessor/parsers/merge.py,sha256=4UIeWwDVg9rJRbTVRvNTyv-mxTA8W5TIgWAvWYXjvhA,5211
15
15
  imgprocessor/parsers/resize.py,sha256=31iJws5YVsqJZN4O-HG9OjGBtKFW_mGE5536pYvWchU,5175
16
16
  imgprocessor/parsers/rotate.py,sha256=Vb23OJuGQrdGRkJWpDJeeVkZUF9bbsRD2e58P5Q1b1k,734
17
17
  imgprocessor/parsers/watermark.py,sha256=MTlRVvtVMR5IyJODk5DMFe01KQKGAulaaNy7f23NvME,8862
18
- py_img_processor-1.2.2.dist-info/LICENSE,sha256=Sr4UxtHWGmoO_enyTUeAN276LkBqJpse0guCcb6f9BQ,1066
19
- py_img_processor-1.2.2.dist-info/METADATA,sha256=KatS0FzZBFI79jx2SfSmdC4N16S-vSuIC6Zg6K2_xEQ,7553
20
- py_img_processor-1.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
21
- py_img_processor-1.2.2.dist-info/entry_points.txt,sha256=MLeLjzpkH7DkDMgICWCQ99D9ElqAvTBVBGA8yjg4dhQ,57
22
- py_img_processor-1.2.2.dist-info/top_level.txt,sha256=5Pm26oHcqZoihGGxc5N6qQJ2LuVa2i4au_uqHBMqehI,13
23
- py_img_processor-1.2.2.dist-info/RECORD,,
18
+ py_img_processor-1.2.3.dist-info/LICENSE,sha256=Sr4UxtHWGmoO_enyTUeAN276LkBqJpse0guCcb6f9BQ,1066
19
+ py_img_processor-1.2.3.dist-info/METADATA,sha256=DoivN4bYUzPjDEdt2cm_4vJAgMdMBZbG0_wRLyT7dhQ,7553
20
+ py_img_processor-1.2.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
21
+ py_img_processor-1.2.3.dist-info/entry_points.txt,sha256=MLeLjzpkH7DkDMgICWCQ99D9ElqAvTBVBGA8yjg4dhQ,57
22
+ py_img_processor-1.2.3.dist-info/top_level.txt,sha256=5Pm26oHcqZoihGGxc5N6qQJ2LuVa2i4au_uqHBMqehI,13
23
+ py_img_processor-1.2.3.dist-info/RECORD,,