fotolab 0.26.3__py3-none-any.whl → 0.27.0__py3-none-any.whl

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.
fotolab/__init__.py CHANGED
@@ -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
 
fotolab/cli.py CHANGED
@@ -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")
@@ -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>
@@ -1,6 +1,6 @@
1
- fotolab/__init__.py,sha256=mQ7OaOJnNZcjO8usZi_l0a_bX5_dNrUENLnp8VQMp2k,2172
1
+ fotolab/__init__.py,sha256=JLPVtm3Ac88Il9-YmaGXkWsbUdbl71qnktYpM3BKhvo,2172
2
2
  fotolab/__main__.py,sha256=aboOURPs_snOXTEWYR0q8oq1UTY9e-NxCd1j33V0wHI,833
3
- fotolab/cli.py,sha256=9rhS-yhX1nE_zKBfR05QyEt-S7Y43mIP0yUQA6bsgV8,4326
3
+ fotolab/cli.py,sha256=fwSpCFW64ACEhH9JZER9OqxULbBzm5eVtkch3E6wwv4,4365
4
4
  fotolab/subcommands/__init__.py,sha256=l3DlIaJ3u3jGjnC1H1yV8LZ_nPqOLJ6gikD4BCaMAQ0,1129
5
5
  fotolab/subcommands/animate.py,sha256=Zp0LPM7ktg6V2rIAP8pof2mmPAph_0O3TEySvg55-h8,2972
6
6
  fotolab/subcommands/auto.py,sha256=p_e1f4mcrIFLqBXMNKvPQRDkNrAlK7FR6sdR5NAR0t8,2427
@@ -9,13 +9,13 @@ fotolab/subcommands/contrast.py,sha256=8uPCd5xI-aUsL7rjdEPmfSskdzMwM-1tv0eRRONkW
9
9
  fotolab/subcommands/env.py,sha256=JamU3a2xWPbwlAj5iThHs58KYkLmjpUphZfTQODBp_4,1471
10
10
  fotolab/subcommands/halftone.py,sha256=Xlbj3nVzqBXLzfemhF66nWV9U-PJHcG1Q2m2HiDhjI0,4322
11
11
  fotolab/subcommands/info.py,sha256=DANbfBNy2SzFfeE4KqOViAZkaME6xujfZvJTHIaZyCY,3312
12
- fotolab/subcommands/montage.py,sha256=hhRH9LsWxXa86_qtVDKGvk--Eap2nP17OTy81kq3Xjk,2048
12
+ fotolab/subcommands/montage.py,sha256=TrMcYIeuzNHev-QGbBCA3htBfDjxPomtMXNtlKGBRmw,2145
13
13
  fotolab/subcommands/resize.py,sha256=d2Nlslzlvri9L2rqmE-HbmnLozylSk3U1Hi3DF1q3Mc,5023
14
- fotolab/subcommands/rotate.py,sha256=vhtiAD5r0i5humpjyAbkoxh2nQsSuBYUD-TgcECwUwE,2149
14
+ fotolab/subcommands/rotate.py,sha256=wRWRG4PMLmw5kOi6NsLsNkh0Aw2WaBAdScWfBwGjDeM,2156
15
15
  fotolab/subcommands/sharpen.py,sha256=xz8RW8cRPM4eUvJTO1Stsur3G67DBftVGza8kF5j2Pc,3700
16
16
  fotolab/subcommands/watermark.py,sha256=a4GEVZG64B1giUigweXvDGS-Y7PeBXFyyrsHuko6ClQ,8124
17
- fotolab-0.26.3.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
18
- fotolab-0.26.3.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
19
- fotolab-0.26.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
20
- fotolab-0.26.3.dist-info/METADATA,sha256=unUGTv1OHqdprfMt-jC5fCEeeBpIi2TQxeq81y2jGmg,11114
21
- fotolab-0.26.3.dist-info/RECORD,,
17
+ fotolab-0.27.0.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
18
+ fotolab-0.27.0.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
19
+ fotolab-0.27.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
20
+ fotolab-0.27.0.dist-info/METADATA,sha256=MmQBQofr3eMnOji4Vx9jGooDml3k_5GCqS3ak3I0wto,11114
21
+ fotolab-0.27.0.dist-info/RECORD,,