fotolab 0.26.3__tar.gz → 0.27.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.
Files changed (43) hide show
  1. {fotolab-0.26.3 → fotolab-0.27.0}/.coveragerc +0 -1
  2. {fotolab-0.26.3 → fotolab-0.27.0}/CHANGELOG.md +9 -0
  3. {fotolab-0.26.3 → fotolab-0.27.0}/PKG-INFO +1 -1
  4. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/__init__.py +1 -1
  5. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/cli.py +4 -1
  6. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/montage.py +3 -0
  7. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/rotate.py +2 -6
  8. {fotolab-0.26.3 → fotolab-0.27.0}/noxfile.py +3 -1
  9. {fotolab-0.26.3 → fotolab-0.27.0}/.gitignore +0 -0
  10. {fotolab-0.26.3 → fotolab-0.27.0}/.pre-commit-config.yaml +0 -0
  11. {fotolab-0.26.3 → fotolab-0.27.0}/.python-version +0 -0
  12. {fotolab-0.26.3 → fotolab-0.27.0}/CONTRIBUTING.md +0 -0
  13. {fotolab-0.26.3 → fotolab-0.27.0}/LICENSE.md +0 -0
  14. {fotolab-0.26.3 → fotolab-0.27.0}/Pipfile +0 -0
  15. {fotolab-0.26.3 → fotolab-0.27.0}/Pipfile.lock +0 -0
  16. {fotolab-0.26.3 → fotolab-0.27.0}/README.md +0 -0
  17. {fotolab-0.26.3 → fotolab-0.27.0}/docs/Makefile +0 -0
  18. {fotolab-0.26.3 → fotolab-0.27.0}/docs/make.bat +0 -0
  19. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/CHANGELOG.md +0 -0
  20. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/CONTRIBUTING.md +0 -0
  21. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/LICENSE.md +0 -0
  22. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/README.md +0 -0
  23. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/_static/logo.jpg +0 -0
  24. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/conf.py +0 -0
  25. {fotolab-0.26.3 → fotolab-0.27.0}/docs/source/index.rst +0 -0
  26. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/__main__.py +0 -0
  27. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/__init__.py +0 -0
  28. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/animate.py +0 -0
  29. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/auto.py +0 -0
  30. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/border.py +0 -0
  31. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/contrast.py +0 -0
  32. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/env.py +0 -0
  33. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/halftone.py +0 -0
  34. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/info.py +0 -0
  35. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/resize.py +0 -0
  36. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/sharpen.py +0 -0
  37. {fotolab-0.26.3 → fotolab-0.27.0}/fotolab/subcommands/watermark.py +0 -0
  38. {fotolab-0.26.3 → fotolab-0.27.0}/pyproject.toml +0 -0
  39. {fotolab-0.26.3 → fotolab-0.27.0}/tests/__init__.py +0 -0
  40. {fotolab-0.26.3 → fotolab-0.27.0}/tests/conftest.py +0 -0
  41. {fotolab-0.26.3 → fotolab-0.27.0}/tests/test_env_subcommand.py +0 -0
  42. {fotolab-0.26.3 → fotolab-0.27.0}/tests/test_help_flag.py +0 -0
  43. {fotolab-0.26.3 → fotolab-0.27.0}/tests/test_quiet_flag.py +0 -0
@@ -1,5 +1,4 @@
1
1
  [run]
2
- concurrency = multiprocessing
3
2
  parallel = true
4
3
  sigterm = true
5
4
  source = fotolab
@@ -7,6 +7,15 @@ and this project adheres to [0-based versioning](https://0ver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## v0.27.0 (2025-02-16)
11
+
12
+ - Explicitly name the attribute for the subcommand
13
+ - Refactor rotation calculation
14
+ - Set coverage to use parallel mode
15
+ - Use ast.Constant as ast.Str is deprecated for python 3.8+
16
+ - Use bicubic resampling when rotating image
17
+ - Validate that two images needed for montage subcommand
18
+
10
19
  ## v0.26.3 (2025-02-09)
11
20
 
12
21
  - Bump `pre-commit` hooks
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fotolab
3
- Version: 0.26.3
3
+ Version: 0.27.0
4
4
  Summary: A console program that manipulate images.
5
5
  Keywords: photography,photo
6
6
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
@@ -20,7 +20,7 @@ import subprocess
20
20
  import sys
21
21
  from pathlib import Path
22
22
 
23
- __version__ = "0.26.3"
23
+ __version__ = "0.27.0"
24
24
 
25
25
  log = logging.getLogger(__name__)
26
26
 
@@ -129,7 +129,10 @@ def build_parser() -> argparse.ArgumentParser:
129
129
  version=f"%(prog)s {__version__}",
130
130
  )
131
131
 
132
- subparsers = parser.add_subparsers(help="sub-command help")
132
+ subparsers = parser.add_subparsers(
133
+ help="sub-command help",
134
+ dest="command",
135
+ )
133
136
  fotolab.subcommands.build_subparser(subparsers)
134
137
 
135
138
  return parser
@@ -57,6 +57,9 @@ def run(args: argparse.Namespace) -> None:
57
57
  for image_filename in args.image_filenames:
58
58
  images.append(Image.open(image_filename.name))
59
59
 
60
+ if len(images) < 2:
61
+ raise ValueError("At least two images is required for montage")
62
+
60
63
  total_width = sum(img.width for img in images)
61
64
  total_height = max(img.height for img in images)
62
65
 
@@ -67,14 +67,10 @@ def run(args: argparse.Namespace) -> None:
67
67
  """
68
68
  log.debug(args)
69
69
 
70
- rotation = args.rotation
71
- if args.clockwise:
72
- rotation = -rotation
73
-
70
+ rotation = -args.rotation if args.clockwise else args.rotation
74
71
  for image_filename in args.image_filenames:
75
72
  original_image = Image.open(image_filename)
76
73
  rotated_image = original_image.rotate(
77
- rotation,
78
- expand=True,
74
+ rotation, expand=True, resample=Image.Resampling.BICUBIC
79
75
  )
80
76
  save_image(args, rotated_image, image_filename, "rotate")
@@ -133,7 +133,9 @@ def release(session: nox.Session) -> None:
133
133
  for node in ast.walk(tree):
134
134
  if isinstance(node, ast.Assign) and len(node.targets) == 1:
135
135
  target, value = node.targets[0], node.value
136
- if target.id == "__version__" and isinstance(value, ast.Str):
136
+ if target.id == "__version__" and isinstance(
137
+ value, ast.Constant
138
+ ):
137
139
  current_version = value.s
138
140
  break
139
141
 
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