Coverage for src/lektor_ng/imagetools/__init__.py: 100%
12 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-08-31 01:05 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-08-31 01:05 +0000
1from __future__ import annotations
3from pathlib import Path
5from ..utils import deprecated
6from .exif import read_exif
7from .image_info import get_image_info
8from .thumbnail import (
9 Thumbnail,
10 ThumbnailMode,
11 compute_dimensions,
12 make_image_thumbnail,
13)
15__all__ = [
16 "Thumbnail",
17 "ThumbnailMode",
18 "compute_dimensions",
19 "get_image_info",
20 "get_quality",
21 "make_image_thumbnail",
22 "read_exif",
23]
26@deprecated(version="3.4.0")
27def get_quality(source_filename: str | Path) -> int:
28 """Get the effective default thumbnail _quality_.
30 This is the ImageMagick "quality" that is used, by default, when generating
31 thumbnails.
33 """
34 if get_image_info(source_filename).format == "png":
35 return 75
36 return 85