imageunblur-preflight 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 imageunblur-preflight contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: imageunblur-preflight
3
+ Version: 0.1.0
4
+ Summary: Check image file metadata against Image Unblur upload limits locally
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://imageunblur.ai/
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Environment :: Console
9
+ Classifier: Topic :: Multimedia :: Graphics
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: Pillow<13,>=10
14
+ Dynamic: license-file
15
+
16
+ # Image Unblur Preflight
17
+
18
+ Inspect a local image's format, byte size, dimensions, and frame count before uploading it. The check reflects the website's published limits: JPG/PNG/WebP, up to 20 MB and 24 megapixels, and 64–16,384 pixels per side. It does not evaluate sharpness or send an image anywhere.
19
+
20
+ ```bash
21
+ pip install imageunblur-preflight
22
+ imageunblur-preflight blurry-photo.jpg
23
+ ```
24
+
25
+ Inspect the original at full size before choosing an enhancement model. For eligible files, [unblur image online](https://imageunblur.ai/) offers a browser workflow; compare its output with the original, especially around faces, text, and fine edges. A sharper generated image cannot prove that missing detail was originally present.
26
+
27
+ Check the official site for current upload limits before relying on this package in an automated workflow.
@@ -0,0 +1,12 @@
1
+ # Image Unblur Preflight
2
+
3
+ Inspect a local image's format, byte size, dimensions, and frame count before uploading it. The check reflects the website's published limits: JPG/PNG/WebP, up to 20 MB and 24 megapixels, and 64–16,384 pixels per side. It does not evaluate sharpness or send an image anywhere.
4
+
5
+ ```bash
6
+ pip install imageunblur-preflight
7
+ imageunblur-preflight blurry-photo.jpg
8
+ ```
9
+
10
+ Inspect the original at full size before choosing an enhancement model. For eligible files, [unblur image online](https://imageunblur.ai/) offers a browser workflow; compare its output with the original, especially around faces, text, and fine edges. A sharper generated image cannot prove that missing detail was originally present.
11
+
12
+ Check the official site for current upload limits before relying on this package in an automated workflow.
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: imageunblur-preflight
3
+ Version: 0.1.0
4
+ Summary: Check image file metadata against Image Unblur upload limits locally
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://imageunblur.ai/
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Environment :: Console
9
+ Classifier: Topic :: Multimedia :: Graphics
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: Pillow<13,>=10
14
+ Dynamic: license-file
15
+
16
+ # Image Unblur Preflight
17
+
18
+ Inspect a local image's format, byte size, dimensions, and frame count before uploading it. The check reflects the website's published limits: JPG/PNG/WebP, up to 20 MB and 24 megapixels, and 64–16,384 pixels per side. It does not evaluate sharpness or send an image anywhere.
19
+
20
+ ```bash
21
+ pip install imageunblur-preflight
22
+ imageunblur-preflight blurry-photo.jpg
23
+ ```
24
+
25
+ Inspect the original at full size before choosing an enhancement model. For eligible files, [unblur image online](https://imageunblur.ai/) offers a browser workflow; compare its output with the original, especially around faces, text, and fine edges. A sharper generated image cannot prove that missing detail was originally present.
26
+
27
+ Check the official site for current upload limits before relying on this package in an automated workflow.
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ imageunblur_preflight.py
4
+ pyproject.toml
5
+ imageunblur_preflight.egg-info/PKG-INFO
6
+ imageunblur_preflight.egg-info/SOURCES.txt
7
+ imageunblur_preflight.egg-info/dependency_links.txt
8
+ imageunblur_preflight.egg-info/entry_points.txt
9
+ imageunblur_preflight.egg-info/requires.txt
10
+ imageunblur_preflight.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ imageunblur-preflight = imageunblur_preflight:main
@@ -0,0 +1 @@
1
+ imageunblur_preflight
@@ -0,0 +1,55 @@
1
+ """Check local image metadata before using an online image enhancement tool."""
2
+
3
+ import argparse
4
+ import json
5
+ from pathlib import Path
6
+
7
+
8
+ SUPPORTED = {"JPEG", "PNG", "WEBP"}
9
+ MAX_BYTES = 20_000_000
10
+ MAX_PIXELS = 24_000_000
11
+
12
+
13
+ def check_metadata(image_format: str, size_bytes: int, width: int, height: int, frames: int = 1) -> dict:
14
+ errors = []
15
+ normalized = image_format.upper()
16
+ if normalized not in SUPPORTED:
17
+ errors.append("Use JPG, PNG, or WebP")
18
+ if size_bytes < 0 or size_bytes > MAX_BYTES:
19
+ errors.append("File must be at most 20 MB")
20
+ if not (64 <= width <= 16384 and 64 <= height <= 16384):
21
+ errors.append("Each side must be between 64 and 16,384 pixels")
22
+ if width * height > MAX_PIXELS:
23
+ errors.append("Image must be at most 24 megapixels")
24
+ if frames != 1:
25
+ errors.append("Animated or multi-frame images are not supported")
26
+ return {"accepted_by_published_limits": not errors, "format": normalized,
27
+ "size_bytes": size_bytes, "width": width, "height": height,
28
+ "megapixels": round(width * height / 1_000_000, 2), "frames": frames, "errors": errors}
29
+
30
+
31
+ def inspect_file(path: str) -> dict:
32
+ from PIL import Image
33
+
34
+ target = Path(path)
35
+ with Image.open(target) as image:
36
+ result = check_metadata(image.format or "unknown", target.stat().st_size,
37
+ image.width, image.height, getattr(image, "n_frames", 1))
38
+ result["file"] = str(target)
39
+ return result
40
+
41
+
42
+ def main(argv=None) -> int:
43
+ parser = argparse.ArgumentParser(description=__doc__)
44
+ parser.add_argument("image_file")
45
+ args = parser.parse_args(argv)
46
+ try:
47
+ report = inspect_file(args.image_file)
48
+ except (OSError, ValueError) as exc:
49
+ parser.error(str(exc))
50
+ print(json.dumps(report, indent=2))
51
+ return 0 if report["accepted_by_published_limits"] else 1
52
+
53
+
54
+ if __name__ == "__main__":
55
+ raise SystemExit(main())
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "imageunblur-preflight"
7
+ version = "0.1.0"
8
+ description = "Check image file metadata against Image Unblur upload limits locally"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ dependencies = ["Pillow>=10,<13"]
13
+ classifiers = ["Programming Language :: Python :: 3", "Environment :: Console", "Topic :: Multimedia :: Graphics"]
14
+
15
+ [project.urls]
16
+ Homepage = "https://imageunblur.ai/"
17
+
18
+ [project.scripts]
19
+ imageunblur-preflight = "imageunblur_preflight:main"
20
+
21
+ [tool.setuptools]
22
+ py-modules = ["imageunblur_preflight"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+