py-img-processor 1.0.1__tar.gz → 1.0.3__tar.gz

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.

Potentially problematic release.


This version of py-img-processor might be problematic. Click here for more details.

Files changed (30) hide show
  1. {py_img_processor-1.0.1/py_img_processor.egg-info → py_img_processor-1.0.3}/PKG-INFO +1 -1
  2. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/__init__.py +1 -1
  3. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/__init__.py +1 -1
  4. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/base.py +2 -8
  5. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/processor.py +1 -1
  6. {py_img_processor-1.0.1 → py_img_processor-1.0.3/py_img_processor.egg-info}/PKG-INFO +1 -1
  7. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/LICENSE +0 -0
  8. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/MANIFEST.in +0 -0
  9. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/README.md +0 -0
  10. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/enums.py +0 -0
  11. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/exceptions.py +0 -0
  12. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/main.py +0 -0
  13. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/alpha.py +0 -0
  14. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/blur.py +0 -0
  15. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/circle.py +0 -0
  16. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/crop.py +0 -0
  17. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/gray.py +0 -0
  18. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/merge.py +0 -0
  19. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/resize.py +0 -0
  20. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/rotate.py +0 -0
  21. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/parsers/watermark.py +0 -0
  22. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/imgprocessor/utils.py +0 -0
  23. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/SOURCES.txt +0 -0
  24. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/dependency_links.txt +0 -0
  25. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/entry_points.txt +0 -0
  26. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/not-zip-safe +0 -0
  27. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/requires.txt +0 -0
  28. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/py_img_processor.egg-info/top_level.txt +0 -0
  29. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/setup.cfg +0 -0
  30. {py_img_processor-1.0.1 → py_img_processor-1.0.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-img-processor
3
- Version: 1.0.1
3
+ Version: 1.0.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
@@ -5,7 +5,7 @@ import importlib
5
5
 
6
6
 
7
7
  __all__ = ["settings", "VERSION"]
8
- __version__ = "1.0.1"
8
+ __version__ = "1.0.3"
9
9
 
10
10
 
11
11
  VERSION = __version__
@@ -38,7 +38,7 @@ class ProcessParams(object):
38
38
  actions: typing.Optional[list] = None,
39
39
  **kwargs: typing.Any,
40
40
  ) -> None:
41
- self.save_parser: ImgSaveParser = ImgSaveParser.init(kwargs, enable_base64=enable_base64)
41
+ self.save_parser: ImgSaveParser = ImgSaveParser.init(kwargs, enable_base64=enable_base64) # type: ignore
42
42
 
43
43
  _actions = []
44
44
  for i in actions or []:
@@ -1,11 +1,5 @@
1
1
  import typing
2
2
 
3
- try:
4
- # python3.11只后
5
- from typing import Self # type: ignore
6
- except Exception:
7
- from typing_extensions import Self
8
-
9
3
  import re
10
4
 
11
5
  from PIL import Image, ImageOps
@@ -23,14 +17,14 @@ class BaseParser(object):
23
17
  pass
24
18
 
25
19
  @classmethod
26
- def init(cls, data: dict, enable_base64: bool = False) -> Self:
20
+ def init(cls, data: dict, enable_base64: bool = False) -> "BaseParser":
27
21
  params = cls.validate_args(enable_base64=enable_base64, **data)
28
22
  ins = cls(**params)
29
23
  ins.validate()
30
24
  return ins
31
25
 
32
26
  @classmethod
33
- def init_by_str(cls, param_str: str) -> Self:
27
+ def init_by_str(cls, param_str: str) -> "BaseParser":
34
28
  data = cls.parse_str(param_str)
35
29
  return cls.init(data, enable_base64=True)
36
30
 
@@ -99,7 +99,7 @@ def extract_main_color(img_path: str, delta_h: float = 0.3) -> str:
99
99
 
100
100
  Args:
101
101
  img_path: 输入图像的路径
102
- delta_h: 像素色相和平均色相做减法的绝对值小于改值,才用于计算主色调,取值范围[0,1]
102
+ delta_h: 像素色相和平均色相做减法的绝对值小于该值,才用于计算主色调,取值范围[0,1]
103
103
 
104
104
  Returns:
105
105
  颜色值,eg: FFFFFF
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-img-processor
3
- Version: 1.0.1
3
+ Version: 1.0.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