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.
Files changed (117) hide show
  1. {open_autotools-0.0.5 → open_autotools-0.0.6/Open_AutoTools.egg-info}/PKG-INFO +13 -2
  2. {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/requires.txt +1 -0
  3. {open_autotools-0.0.5/Open_AutoTools.egg-info → open_autotools-0.0.6}/PKG-INFO +13 -2
  4. {open_autotools-0.0.5 → open_autotools-0.0.6}/README.md +11 -1
  5. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_image.py +10 -0
  6. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/core.py +1 -1
  7. {open_autotools-0.0.5 → open_autotools-0.0.6}/requirements.txt +1 -0
  8. {open_autotools-0.0.5 → open_autotools-0.0.6}/setup.py +1 -1
  9. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_core.py +2 -0
  10. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_image.py +49 -0
  11. {open_autotools-0.0.5 → open_autotools-0.0.6}/LICENSE +0 -0
  12. {open_autotools-0.0.5 → open_autotools-0.0.6}/MANIFEST.in +0 -0
  13. {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/SOURCES.txt +0 -0
  14. {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/dependency_links.txt +0 -0
  15. {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/entry_points.txt +0 -0
  16. {open_autotools-0.0.5 → open_autotools-0.0.6}/Open_AutoTools.egg-info/top_level.txt +0 -0
  17. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/__init__.py +0 -0
  18. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/__init__.py +0 -0
  19. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/commands.py +0 -0
  20. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocaps/core.py +0 -0
  21. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/__init__.py +0 -0
  22. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/commands.py +0 -0
  23. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autocolor/core.py +0 -0
  24. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/__init__.py +0 -0
  25. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/commands.py +0 -0
  26. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/__init__.py +0 -0
  27. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_audio.py +0 -0
  28. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_text.py +0 -0
  29. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoconvert/conversion/convert_video.py +0 -0
  30. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/__init__.py +0 -0
  31. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/commands.py +0 -0
  32. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autoip/core.py +0 -0
  33. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/__init__.py +0 -0
  34. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/commands.py +0 -0
  35. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autolower/core.py +0 -0
  36. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/__init__.py +0 -0
  37. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/commands.py +0 -0
  38. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autonote/core.py +0 -0
  39. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/__init__.py +0 -0
  40. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/commands.py +0 -0
  41. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autopassword/core.py +0 -0
  42. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotest/__init__.py +0 -0
  43. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotest/commands.py +0 -0
  44. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/__init__.py +0 -0
  45. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/commands.py +0 -0
  46. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autotodo/core.py +0 -0
  47. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/__init__.py +0 -0
  48. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/commands.py +0 -0
  49. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autounit/core.py +0 -0
  50. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/__init__.py +0 -0
  51. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/commands.py +0 -0
  52. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/autozip/core.py +0 -0
  53. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/cli.py +0 -0
  54. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/__init__.py +0 -0
  55. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/commands.py +0 -0
  56. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/loading.py +0 -0
  57. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/performance.py +0 -0
  58. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/requirements.py +0 -0
  59. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/smoke.py +0 -0
  60. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/text.py +0 -0
  61. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/updates.py +0 -0
  62. {open_autotools-0.0.5 → open_autotools-0.0.6}/autotools/utils/version.py +0 -0
  63. {open_autotools-0.0.5 → open_autotools-0.0.6}/pyproject.toml +0 -0
  64. {open_autotools-0.0.5 → open_autotools-0.0.6}/setup.cfg +0 -0
  65. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/__init__.py +0 -0
  66. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/__init__.py +0 -0
  67. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_core.py +0 -0
  68. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocaps/test_autocaps_integration.py +0 -0
  69. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/__init__.py +0 -0
  70. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/test_autocolor_core.py +0 -0
  71. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autocolor/test_autocolor_integration.py +0 -0
  72. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/__init__.py +0 -0
  73. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/conftest.py +0 -0
  74. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/integration/__init__.py +0 -0
  75. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/integration/test_convert_commands.py +0 -0
  76. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/__init__.py +0 -0
  77. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_audio.py +0 -0
  78. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_text.py +0 -0
  79. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoconvert/unit/test_convert_video.py +0 -0
  80. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/__init__.py +0 -0
  81. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/test_autoip_core.py +0 -0
  82. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autoip/test_autoip_integration.py +0 -0
  83. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/__init__.py +0 -0
  84. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/test_autolower_core.py +0 -0
  85. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autolower/test_autolower_integration.py +0 -0
  86. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/__init__.py +0 -0
  87. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/conftest.py +0 -0
  88. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_core.py +0 -0
  89. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autonote/test_autonote_integration.py +0 -0
  90. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autopassword/test_autopassword_core.py +0 -0
  91. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autopassword/test_autopassword_integration.py +0 -0
  92. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotest/__init__.py +0 -0
  93. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotest/test_autotest_core.py +0 -0
  94. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/__init__.py +0 -0
  95. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/conftest.py +0 -0
  96. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_coverage.py +0 -0
  97. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_file_operations.py +0 -0
  98. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_integration.py +0 -0
  99. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_operations.py +0 -0
  100. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_sections.py +0 -0
  101. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_tasks.py +0 -0
  102. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autotodo/test_autotodo_utils.py +0 -0
  103. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/__init__.py +0 -0
  104. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_core.py +0 -0
  105. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autounit/test_autounit_integration.py +0 -0
  106. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/__init__.py +0 -0
  107. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/test_autozip_core.py +0 -0
  108. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/autozip/test_autozip_integration.py +0 -0
  109. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/__init__.py +0 -0
  110. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_commands_discovery.py +0 -0
  111. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_performance.py +0 -0
  112. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_requirements.py +0 -0
  113. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_smoke.py +0 -0
  114. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_text.py +0 -0
  115. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_updates.py +0 -0
  116. {open_autotools-0.0.5 → open_autotools-0.0.6}/tests/autotools/utils/test_version.py +0 -0
  117. {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.5
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] [![Python][PYTHON_BADGE]][PYTHON_URL] [![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL] [![TODO][TODO_BADGE]][TODO_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
 
@@ -8,6 +8,7 @@ speedtest-cli>=2.1.3
8
8
  psutil>=5.9.0
9
9
  cryptography>=42.0.2
10
10
  Pillow>=10.0.0
11
+ pillow-heif>=0.16.0
11
12
  pydub>=0.25.1
12
13
  moviepy>=1.0.3
13
14
  pint>=0.23
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Open-AutoTools
3
- Version: 0.0.5
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] [![Python][PYTHON_BADGE]][PYTHON_URL] [![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL] [![TODO][TODO_BADGE]][TODO_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] [![Python][PYTHON_BADGE]][PYTHON_URL] [![CHANGELOG][CHANGELOG_BADGE]][CHANGELOG_URL] [![TODO][TODO_BADGE]][TODO_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
 
@@ -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
@@ -8,6 +8,7 @@ speedtest-cli>=2.1.3
8
8
  psutil>=5.9.0
9
9
  cryptography>=42.0.2
10
10
  Pillow>=10.0.0
11
+ pillow-heif>=0.16.0
11
12
  pydub>=0.25.1
12
13
  moviepy>=1.0.3
13
14
  pint>=0.23
@@ -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.5',
21
+ version='0.0.6',
22
22
  packages=find_packages(exclude=["tests", "tests.*"]),
23
23
  include_package_data=True,
24
24
  install_requires=required,
@@ -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():
@@ -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