batch-img 0.2.2__tar.gz → 0.2.4__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.
- {batch_img-0.2.2/batch_img.egg-info → batch_img-0.2.4}/PKG-INFO +3 -3
- {batch_img-0.2.2 → batch_img-0.2.4}/README.md +2 -2
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/auto.py +4 -4
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/common.py +1 -1
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/const.py +3 -3
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/interface.py +1 -1
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/log.py +5 -6
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/main.py +8 -8
- {batch_img-0.2.2 → batch_img-0.2.4/batch_img.egg-info}/PKG-INFO +3 -3
- {batch_img-0.2.2 → batch_img-0.2.4}/pyproject.toml +1 -1
- {batch_img-0.2.2 → batch_img-0.2.4}/LICENSE +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/MANIFEST.in +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/__init__.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/border.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/config.json +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/no_gps.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/orientation.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/resize.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/rotate.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img/transparent.py +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img.egg-info/SOURCES.txt +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img.egg-info/dependency_links.txt +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img.egg-info/entry_points.txt +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img.egg-info/requires.txt +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/batch_img.egg-info/top_level.txt +0 -0
- {batch_img-0.2.2 → batch_img-0.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batch_img
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Batch process (resize, rotate, remove GPS, add border, set transparency, auto do all) image files (HEIC, JPG, PNG)
|
|
5
5
|
Author-email: John Liu <rim2rim@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -94,7 +94,7 @@ Options:
|
|
|
94
94
|
--help Show this message and exit.
|
|
95
95
|
|
|
96
96
|
Commands:
|
|
97
|
-
auto Auto process (resize to
|
|
97
|
+
auto Auto process (resize to 1920, remove GPS, add border)...
|
|
98
98
|
border Add internal border to image file(s), not expand the size.
|
|
99
99
|
no-gps Remove GPS location info in image file(s).
|
|
100
100
|
resize Resize image file(s).
|
|
@@ -108,7 +108,7 @@ Commands:
|
|
|
108
108
|
✗ batch_img auto --help
|
|
109
109
|
Usage: batch_img auto [OPTIONS] SRC_PATH
|
|
110
110
|
|
|
111
|
-
Auto process (resize to
|
|
111
|
+
Auto process (resize to 1920, remove GPS, add border) image file(s).
|
|
112
112
|
|
|
113
113
|
Options:
|
|
114
114
|
-ar, --auto_rotate Auto-rotate image (experimental)
|
|
@@ -66,7 +66,7 @@ Options:
|
|
|
66
66
|
--help Show this message and exit.
|
|
67
67
|
|
|
68
68
|
Commands:
|
|
69
|
-
auto Auto process (resize to
|
|
69
|
+
auto Auto process (resize to 1920, remove GPS, add border)...
|
|
70
70
|
border Add internal border to image file(s), not expand the size.
|
|
71
71
|
no-gps Remove GPS location info in image file(s).
|
|
72
72
|
resize Resize image file(s).
|
|
@@ -80,7 +80,7 @@ Commands:
|
|
|
80
80
|
✗ batch_img auto --help
|
|
81
81
|
Usage: batch_img auto [OPTIONS] SRC_PATH
|
|
82
82
|
|
|
83
|
-
Auto process (resize to
|
|
83
|
+
Auto process (resize to 1920, remove GPS, add border) image file(s).
|
|
84
84
|
|
|
85
85
|
Options:
|
|
86
86
|
-ar, --auto_rotate Auto-rotate image (experimental)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""class Auto - do auto actions to the image file(s):
|
|
2
|
-
* Resize to
|
|
3
|
-
* Add
|
|
2
|
+
* Resize to 1920-pixel max length
|
|
3
|
+
* Add 5-pixel width black color border
|
|
4
4
|
* Remove GPS location info
|
|
5
5
|
Copyright © 2025 John Liu
|
|
6
6
|
"""
|
|
@@ -24,8 +24,8 @@ class Auto:
|
|
|
24
24
|
@staticmethod
|
|
25
25
|
def process_an_image(in_path: Path, out_path: Path | str) -> tuple:
|
|
26
26
|
"""Process an image file:
|
|
27
|
-
* Resize to
|
|
28
|
-
* Add
|
|
27
|
+
* Resize to 1920-pixel max length
|
|
28
|
+
* Add 5-pixel width black color border
|
|
29
29
|
* Remove GPS location info
|
|
30
30
|
|
|
31
31
|
Args:
|
|
@@ -23,9 +23,9 @@ PATTERNS = (
|
|
|
23
23
|
)
|
|
24
24
|
REPLACE = "replace"
|
|
25
25
|
EXIF = "exif"
|
|
26
|
-
# Resize to
|
|
27
|
-
# Add
|
|
26
|
+
# Resize to 1920-pixel max length
|
|
27
|
+
# Add 5-pixel width black color border
|
|
28
28
|
# Remove GPS location info
|
|
29
|
-
MAX_LENGTH =
|
|
29
|
+
MAX_LENGTH = 1920
|
|
30
30
|
BD_WIDTH = 5
|
|
31
31
|
BD_COLOR = "black"
|
|
@@ -22,7 +22,7 @@ def cli(ctx, update, version): # pragma: no cover
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@cli.command(
|
|
25
|
-
help="Auto process (resize to
|
|
25
|
+
help="Auto process (resize to 1920, remove GPS, add border) image file(s)."
|
|
26
26
|
)
|
|
27
27
|
@click.argument(
|
|
28
28
|
"src_path",
|
|
@@ -50,8 +50,8 @@ class Log:
|
|
|
50
50
|
backtrace = True
|
|
51
51
|
diagnose = True
|
|
52
52
|
else:
|
|
53
|
-
#
|
|
54
|
-
logformat = "
|
|
53
|
+
# Simplify production log output
|
|
54
|
+
logformat = "<level>{message}</level>"
|
|
55
55
|
backtrace = False
|
|
56
56
|
diagnose = False
|
|
57
57
|
return level, logformat, backtrace, diagnose, to_file
|
|
@@ -77,8 +77,7 @@ class Log:
|
|
|
77
77
|
)
|
|
78
78
|
if not to_file:
|
|
79
79
|
return Log._file
|
|
80
|
-
|
|
81
|
-
Log._file = f"run_{PKG_NAME}_{pid}_{datetime.now().strftime(TS_FORMAT)}.log"
|
|
80
|
+
Log._file = f"run_{PKG_NAME}_{datetime.now().strftime(TS_FORMAT)}.log"
|
|
82
81
|
log_f = f"{os.getcwd()}/{Log._file}"
|
|
83
82
|
logger.add(
|
|
84
83
|
log_f, level=level, format=logformat, backtrace=backtrace, diagnose=diagnose
|
|
@@ -101,10 +100,10 @@ class Log:
|
|
|
101
100
|
backtrace=backtrace,
|
|
102
101
|
diagnose=diagnose,
|
|
103
102
|
)
|
|
104
|
-
# Not log to file in prod
|
|
103
|
+
# Not log to file in prod for better user experience
|
|
105
104
|
if not to_file:
|
|
106
105
|
return logger
|
|
107
|
-
f = f"run_{
|
|
106
|
+
f = f"run_{PKG_NAME}_{datetime.now().strftime(TS_FORMAT)}.log"
|
|
108
107
|
log_file = f"{os.getcwd()}/{f}"
|
|
109
108
|
logger.add(
|
|
110
109
|
log_file,
|
|
@@ -22,8 +22,8 @@ class Main:
|
|
|
22
22
|
@staticmethod
|
|
23
23
|
def auto(options: dict) -> bool:
|
|
24
24
|
"""Auto process image file(s):
|
|
25
|
-
* Resize to
|
|
26
|
-
* Add
|
|
25
|
+
* Resize to 1920-pixel max length
|
|
26
|
+
* Add 5-pixel width black color border
|
|
27
27
|
* Remove GPS location info
|
|
28
28
|
|
|
29
29
|
Args:
|
|
@@ -38,6 +38,10 @@ class Main:
|
|
|
38
38
|
auto_rotate = options.get("auto_rotate")
|
|
39
39
|
output = options.get("output")
|
|
40
40
|
out = Path(output) if output else REPLACE
|
|
41
|
+
log.info(
|
|
42
|
+
"Resize to 1920-pixel max length. Remove GPS location info."
|
|
43
|
+
" Add 5-pixel width black color border."
|
|
44
|
+
)
|
|
41
45
|
if in_path.is_file():
|
|
42
46
|
ok, _ = Auto.auto_do_1_image((in_path, out, auto_rotate))
|
|
43
47
|
else:
|
|
@@ -170,12 +174,8 @@ class Main:
|
|
|
170
174
|
output = options.get("output")
|
|
171
175
|
out = Path(output) if output else REPLACE
|
|
172
176
|
if in_path.is_file():
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
out,
|
|
176
|
-
transparency,
|
|
177
|
-
white,
|
|
178
|
-
))
|
|
177
|
+
args = (in_path, out, transparency, white)
|
|
178
|
+
ok, _ = Transparent.do_1_image_transparency(args)
|
|
179
179
|
else:
|
|
180
180
|
ok = Transparent.all_images_transparency(in_path, out, transparency, white)
|
|
181
181
|
Common.check_latest_version(PKG_NAME)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batch_img
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Batch process (resize, rotate, remove GPS, add border, set transparency, auto do all) image files (HEIC, JPG, PNG)
|
|
5
5
|
Author-email: John Liu <rim2rim@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -94,7 +94,7 @@ Options:
|
|
|
94
94
|
--help Show this message and exit.
|
|
95
95
|
|
|
96
96
|
Commands:
|
|
97
|
-
auto Auto process (resize to
|
|
97
|
+
auto Auto process (resize to 1920, remove GPS, add border)...
|
|
98
98
|
border Add internal border to image file(s), not expand the size.
|
|
99
99
|
no-gps Remove GPS location info in image file(s).
|
|
100
100
|
resize Resize image file(s).
|
|
@@ -108,7 +108,7 @@ Commands:
|
|
|
108
108
|
✗ batch_img auto --help
|
|
109
109
|
Usage: batch_img auto [OPTIONS] SRC_PATH
|
|
110
110
|
|
|
111
|
-
Auto process (resize to
|
|
111
|
+
Auto process (resize to 1920, remove GPS, add border) image file(s).
|
|
112
112
|
|
|
113
113
|
Options:
|
|
114
114
|
-ar, --auto_rotate Auto-rotate image (experimental)
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools>=80.0"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "batch_img"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
description = "Batch process (resize, rotate, remove GPS, add border, set transparency, auto do all) image files (HEIC, JPG, PNG)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "John Liu", email = "rim2rim@gmail.com" }]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|