Open-AutoTools 0.0.5__tar.gz → 0.0.6__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.
- {open_autotools-0.0.5 → open_autotools-0.0.6/Open_AutoTools.egg-info}/PKG-INFO +13 -2
- {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/requires.txt +1 -0
- {open_autotools-0.0.5/Open_AutoTools.egg-info → open_autotools-0.0.6}/PKG-INFO +13 -2
- {open_autotools-0.0.5 → open_autotools-0.0.6}/README.md +11 -1
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_image.py +10 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/core.py +1 -1
- {open_autotools-0.0.5 → open_autotools-0.0.6}/requirements.txt +1 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/setup.py +1 -1
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_core.py +2 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_image.py +49 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/LICENSE +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/MANIFEST.in +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/SOURCES.txt +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/dependency_links.txt +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/entry_points.txt +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/top_level.txt +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_audio.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_text.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_video.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotest/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotest/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/cli.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/loading.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/performance.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/requirements.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/smoke.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/text.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/updates.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/version.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/pyproject.toml +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/setup.cfg +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/test_autocolor_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/test_autocolor_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/conftest.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/integration/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/integration/test_convert_commands.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_audio.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_text.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_video.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/test_autoip_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/test_autoip_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/test_autolower_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/test_autolower_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/conftest.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autopassword/test_autopassword_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autopassword/test_autopassword_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotest/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotest/test_autotest_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/conftest.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_coverage.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_file_operations.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_operations.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_sections.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_tasks.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_utils.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/test_autozip_core.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/test_autozip_integration.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/__init__.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_commands_discovery.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_performance.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_requirements.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_smoke.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_text.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_updates.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_version.py +0 -0
- {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Open-AutoTools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A suite of automated tools accessible via CLI with a simple `autotools` command
|
|
5
5
|
Home-page: https://github.com/BabylooPro/Open-AutoTools
|
|
6
6
|
Author: BabylooPro
|
|
@@ -26,6 +26,7 @@ Requires-Dist: speedtest-cli>=2.1.3
|
|
|
26
26
|
Requires-Dist: psutil>=5.9.0
|
|
27
27
|
Requires-Dist: cryptography>=42.0.2
|
|
28
28
|
Requires-Dist: Pillow>=10.0.0
|
|
29
|
+
Requires-Dist: pillow-heif>=0.16.0
|
|
29
30
|
Requires-Dist: pydub>=0.25.1
|
|
30
31
|
Requires-Dist: moviepy>=1.0.3
|
|
31
32
|
Requires-Dist: pint>=0.23
|
|
@@ -63,14 +64,24 @@ Dynamic: summary
|
|
|
63
64
|
|
|
64
65
|
[PYPI_BADGE]: https://badge.fury.io/py/Open-AutoTools.svg
|
|
65
66
|
[PYPI_URL]: https://pypi.org/project/Open-AutoTools/
|
|
67
|
+
|
|
68
|
+
[PYPI_DOWNLOADS_BADGE]: https://img.shields.io/pypi/dm/Open-AutoTools
|
|
69
|
+
[PYPI_DOWNLOADS_URL]: https://pypi.org/project/Open-AutoTools/
|
|
70
|
+
|
|
66
71
|
[PYTHON_BADGE]: https://img.shields.io/badge/Python-3.10+-blue.svg
|
|
67
72
|
[PYTHON_URL]: https://www.python.org/downloads/
|
|
73
|
+
|
|
68
74
|
[CHANGELOG_BADGE]: https://img.shields.io/badge/CHANGELOG-red.svg
|
|
69
75
|
[CHANGELOG_URL]: CHANGELOG.md
|
|
76
|
+
|
|
70
77
|
[TODO_BADGE]: https://img.shields.io/badge/TODO-purple.svg
|
|
71
78
|
[TODO_URL]: TODO.md
|
|
72
79
|
|
|
73
|
-
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
80
|
+
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
81
|
+
[![Python][PYTHON_BADGE]][PYTHON_URL]
|
|
82
|
+
[![Downloads][PYPI_DOWNLOADS_BADGE]][PYPI_DOWNLOADS_URL]
|
|
83
|
+
[![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL]
|
|
84
|
+
[![TODO][TODO_BADGE]][TODO_URL]
|
|
74
85
|
|
|
75
86
|
Python CLI toolkit for everyday developer tasks. Boost productivity directly from your terminal.
|
|
76
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Open-AutoTools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A suite of automated tools accessible via CLI with a simple `autotools` command
|
|
5
5
|
Home-page: https://github.com/BabylooPro/Open-AutoTools
|
|
6
6
|
Author: BabylooPro
|
|
@@ -26,6 +26,7 @@ Requires-Dist: speedtest-cli>=2.1.3
|
|
|
26
26
|
Requires-Dist: psutil>=5.9.0
|
|
27
27
|
Requires-Dist: cryptography>=42.0.2
|
|
28
28
|
Requires-Dist: Pillow>=10.0.0
|
|
29
|
+
Requires-Dist: pillow-heif>=0.16.0
|
|
29
30
|
Requires-Dist: pydub>=0.25.1
|
|
30
31
|
Requires-Dist: moviepy>=1.0.3
|
|
31
32
|
Requires-Dist: pint>=0.23
|
|
@@ -63,14 +64,24 @@ Dynamic: summary
|
|
|
63
64
|
|
|
64
65
|
[PYPI_BADGE]: https://badge.fury.io/py/Open-AutoTools.svg
|
|
65
66
|
[PYPI_URL]: https://pypi.org/project/Open-AutoTools/
|
|
67
|
+
|
|
68
|
+
[PYPI_DOWNLOADS_BADGE]: https://img.shields.io/pypi/dm/Open-AutoTools
|
|
69
|
+
[PYPI_DOWNLOADS_URL]: https://pypi.org/project/Open-AutoTools/
|
|
70
|
+
|
|
66
71
|
[PYTHON_BADGE]: https://img.shields.io/badge/Python-3.10+-blue.svg
|
|
67
72
|
[PYTHON_URL]: https://www.python.org/downloads/
|
|
73
|
+
|
|
68
74
|
[CHANGELOG_BADGE]: https://img.shields.io/badge/CHANGELOG-red.svg
|
|
69
75
|
[CHANGELOG_URL]: CHANGELOG.md
|
|
76
|
+
|
|
70
77
|
[TODO_BADGE]: https://img.shields.io/badge/TODO-purple.svg
|
|
71
78
|
[TODO_URL]: TODO.md
|
|
72
79
|
|
|
73
|
-
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
80
|
+
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
81
|
+
[![Python][PYTHON_BADGE]][PYTHON_URL]
|
|
82
|
+
[![Downloads][PYPI_DOWNLOADS_BADGE]][PYPI_DOWNLOADS_URL]
|
|
83
|
+
[![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL]
|
|
84
|
+
[![TODO][TODO_BADGE]][TODO_URL]
|
|
74
85
|
|
|
75
86
|
Python CLI toolkit for everyday developer tasks. Boost productivity directly from your terminal.
|
|
76
87
|
|
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
[PYPI_BADGE]: https://badge.fury.io/py/Open-AutoTools.svg
|
|
4
4
|
[PYPI_URL]: https://pypi.org/project/Open-AutoTools/
|
|
5
|
+
|
|
6
|
+
[PYPI_DOWNLOADS_BADGE]: https://img.shields.io/pypi/dm/Open-AutoTools
|
|
7
|
+
[PYPI_DOWNLOADS_URL]: https://pypi.org/project/Open-AutoTools/
|
|
8
|
+
|
|
5
9
|
[PYTHON_BADGE]: https://img.shields.io/badge/Python-3.10+-blue.svg
|
|
6
10
|
[PYTHON_URL]: https://www.python.org/downloads/
|
|
11
|
+
|
|
7
12
|
[CHANGELOG_BADGE]: https://img.shields.io/badge/CHANGELOG-red.svg
|
|
8
13
|
[CHANGELOG_URL]: CHANGELOG.md
|
|
14
|
+
|
|
9
15
|
[TODO_BADGE]: https://img.shields.io/badge/TODO-purple.svg
|
|
10
16
|
[TODO_URL]: TODO.md
|
|
11
17
|
|
|
12
|
-
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
18
|
+
[![PyPI][PYPI_BADGE]][PYPI_URL]
|
|
19
|
+
[![Python][PYTHON_BADGE]][PYTHON_URL]
|
|
20
|
+
[![Downloads][PYPI_DOWNLOADS_BADGE]][PYPI_DOWNLOADS_URL]
|
|
21
|
+
[![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL]
|
|
22
|
+
[![TODO][TODO_BADGE]][TODO_URL]
|
|
13
23
|
|
|
14
24
|
Python CLI toolkit for everyday developer tasks. Boost productivity directly from your terminal.
|
|
15
25
|
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_image.py
RENAMED
|
@@ -6,11 +6,21 @@ from typing import Optional
|
|
|
6
6
|
def convert_image(input_path: str, output_path: str, output_format: Optional[str] = None) -> bool:
|
|
7
7
|
try:
|
|
8
8
|
from PIL import Image
|
|
9
|
+
input_ext = Path(input_path).suffix[1:].lower()
|
|
10
|
+
if input_ext in ('heic', 'heif'):
|
|
11
|
+
try:
|
|
12
|
+
from pillow_heif import register_heif_opener
|
|
13
|
+
register_heif_opener()
|
|
14
|
+
except ImportError:
|
|
15
|
+
pass
|
|
9
16
|
|
|
10
17
|
if not os.path.exists(input_path):
|
|
11
18
|
raise FileNotFoundError(f"INPUT FILE NOT FOUND: {input_path}")
|
|
12
19
|
if output_format is None: output_format = Path(output_path).suffix[1:].upper()
|
|
13
20
|
|
|
21
|
+
format_aliases = {'JPG': 'JPEG', 'TIF': 'TIFF'}
|
|
22
|
+
output_format = format_aliases.get(output_format.upper(), output_format.upper())
|
|
23
|
+
|
|
14
24
|
with Image.open(input_path) as img:
|
|
15
25
|
if output_format in ['JPG', 'JPEG'] and img.mode in ('RGBA', 'LA', 'P'):
|
|
16
26
|
rgb_img = Image.new('RGB', img.size, (255, 255, 255))
|
|
@@ -15,7 +15,7 @@ def detect_file_type(file_path: str) -> str:
|
|
|
15
15
|
if ext in text_formats: return 'text'
|
|
16
16
|
|
|
17
17
|
# IMAGE FORMATS
|
|
18
|
-
image_formats = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff', 'tif', 'ico', 'svg']
|
|
18
|
+
image_formats = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff', 'tif', 'ico', 'svg', 'heic', 'heif']
|
|
19
19
|
if ext in image_formats: return 'image'
|
|
20
20
|
|
|
21
21
|
# AUDIO FORMATS
|
|
@@ -18,7 +18,7 @@ dev_required = read_requirements("requirements-dev.txt")
|
|
|
18
18
|
# SETUP CONFIGURATION FOR PACKAGE DISTRIBUTION
|
|
19
19
|
setup(
|
|
20
20
|
name='Open-AutoTools',
|
|
21
|
-
version='0.0.
|
|
21
|
+
version='0.0.6',
|
|
22
22
|
packages=find_packages(exclude=["tests", "tests.*"]),
|
|
23
23
|
include_package_data=True,
|
|
24
24
|
install_requires=required,
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_core.py
RENAMED
|
@@ -22,6 +22,8 @@ def test_detect_file_type_image():
|
|
|
22
22
|
assert detect_file_type("file.png") == "image"
|
|
23
23
|
assert detect_file_type("file.gif") == "image"
|
|
24
24
|
assert detect_file_type("file.webp") == "image"
|
|
25
|
+
assert detect_file_type("file.heic") == "image"
|
|
26
|
+
assert detect_file_type("file.heif") == "image"
|
|
25
27
|
|
|
26
28
|
# TEST DETECT AUDIO FILE TYPE
|
|
27
29
|
def test_detect_file_type_audio():
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_image.py
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
4
|
+
import types
|
|
3
5
|
from unittest.mock import patch, MagicMock
|
|
4
6
|
|
|
5
7
|
from autotools.autoconvert.conversion.convert_image import convert_image
|
|
@@ -85,6 +87,53 @@ def test_convert_image_with_output_format(mock_image, temp_dir, create_test_file
|
|
|
85
87
|
assert result is True
|
|
86
88
|
mock_img.save.assert_called_once_with(output_file, format="PNG")
|
|
87
89
|
|
|
90
|
+
# TEST NORMALIZE JPG TO JPEG FORMAT FOR PIL
|
|
91
|
+
@patch('PIL.Image', create=True)
|
|
92
|
+
def test_convert_image_normalizes_jpg_to_jpeg(mock_image, temp_dir, create_test_file):
|
|
93
|
+
mock_img = MagicMock()
|
|
94
|
+
mock_img.mode = 'RGB'
|
|
95
|
+
mock_image.open.return_value.__enter__.return_value = mock_img
|
|
96
|
+
|
|
97
|
+
input_file = create_test_file("input.jpg", b"fake image data")
|
|
98
|
+
output_file = os.path.join(temp_dir, "output.jpg")
|
|
99
|
+
|
|
100
|
+
result = convert_image(input_file, output_file)
|
|
101
|
+
assert result is True
|
|
102
|
+
mock_img.save.assert_called_once_with(output_file, format="JPEG")
|
|
103
|
+
|
|
104
|
+
# TEST HEIC INPUT REGISTERS PILLOW-HEIF OPENER WHEN AVAILABLE
|
|
105
|
+
@patch('PIL.Image', create=True)
|
|
106
|
+
def test_convert_image_heic_registers_heif_opener(mock_image, monkeypatch, temp_dir, create_test_file):
|
|
107
|
+
mock_img = MagicMock()
|
|
108
|
+
mock_img.mode = 'RGB'
|
|
109
|
+
mock_image.open.return_value.__enter__.return_value = mock_img
|
|
110
|
+
register_mock = MagicMock()
|
|
111
|
+
monkeypatch.setitem(sys.modules, 'pillow_heif', types.SimpleNamespace(register_heif_opener=register_mock))
|
|
112
|
+
|
|
113
|
+
input_file = create_test_file("input.heic", b"fake image data")
|
|
114
|
+
output_file = os.path.join(temp_dir, "output.png")
|
|
115
|
+
|
|
116
|
+
result = convert_image(input_file, output_file)
|
|
117
|
+
assert result is True
|
|
118
|
+
register_mock.assert_called_once()
|
|
119
|
+
mock_img.save.assert_called_once_with(output_file, format="PNG")
|
|
120
|
+
|
|
121
|
+
# TEST HEIC INPUT WITHOUT PILLOW-HEIF FALLS BACK GRACEFULLY
|
|
122
|
+
@patch('PIL.Image', create=True)
|
|
123
|
+
def test_convert_image_heic_without_heif_dependency(mock_image, monkeypatch, temp_dir, create_test_file):
|
|
124
|
+
from ..conftest import mock_import_error
|
|
125
|
+
mock_img = MagicMock()
|
|
126
|
+
mock_img.mode = 'RGB'
|
|
127
|
+
mock_image.open.return_value.__enter__.return_value = mock_img
|
|
128
|
+
mock_import_error(monkeypatch, 'pillow_heif')
|
|
129
|
+
|
|
130
|
+
input_file = create_test_file("input.heic", b"fake image data")
|
|
131
|
+
output_file = os.path.join(temp_dir, "output.png")
|
|
132
|
+
|
|
133
|
+
result = convert_image(input_file, output_file)
|
|
134
|
+
assert result is True
|
|
135
|
+
mock_img.save.assert_called_once_with(output_file, format="PNG")
|
|
136
|
+
|
|
88
137
|
# TEST CONVERT IMAGE FILE NOT FOUND
|
|
89
138
|
def test_convert_image_file_not_found(temp_dir):
|
|
90
139
|
input_file = os.path.join(temp_dir, "nonexistent.jpg")
|
|
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
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_audio.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_text.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_video.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_core.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/test_autocolor_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/integration/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_audio.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_text.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_video.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/test_autoip_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/test_autolower_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_core.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_integration.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autopassword/test_autopassword_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotest/test_autotest_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_coverage.py
RENAMED
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_integration.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_operations.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_sections.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_tasks.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_core.py
RENAMED
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/test_autozip_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_commands_discovery.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|