@@ -16,7 +16,7 @@ imagesize
1616 :target: https://github.com/shibukawa/imagesize_py/blob/main/LICENSE.rst
1717 :alt: License
1818
19- This module analyzes JPEG/JPEG 2000/PNG/GIF/TIFF/SVG/Netpbm/WebP/AVIF image headers and returns image size, DPI, and related metadata.
19+ This module analyzes JPEG/JPEG 2000/PNG/GIF/TIFF/SVG/Netpbm/WebP/BMP/ AVIF/HEIC/HEIF image headers and returns image size, DPI, and related metadata.
2020
2121.. code :: python
2222
@@ -35,16 +35,52 @@ This module is a pure Python module. You can use file like object like file or s
3535
3636Supported Python versions: 3.10-3.14
3737
38+ Installation
39+ ----------------
40+
41+ .. code :: bash
42+
43+ pip install imagesize
44+
45+ For local development setup:
46+
47+ .. code :: bash
48+
49+ python -m venv .venv
50+ source .venv/bin/activate
51+ pip install -e .
52+
53+ Version 2.0 migration notes
54+ -----------------------------
55+
56+ Version 2.0 includes the following updates:
57+
58+ * Added/expanded support for ``BMP ``.
59+ * Added support for ``AVIF ``.
60+ * Added support for ``HEIC/HEIF ``.
61+ * ``imagesize.get_info() `` now returns richer metadata including color depth, channel count, and rotation information.
62+ * Improved EXIF orientation handling so JPEG, TIFF, AVIF, and HEIC/HEIF return sizes that correctly reflect EXIF rotation metadata.
63+ * Added type hints for the public API and related input/output types.
64+
65+ Backward incompatible behavior in 2.0:
66+
67+ * ``imagesize.get() `` now returns ``(-1, -1) `` when parsing fails.
68+ * ``imagesize.getDPI() `` now returns ``(-1, -1) `` when parsing fails.
69+
70+ If your existing code relied on exceptions during parse failures, update it to explicitly check return values.
71+
3872API
3973-----
4074
4175* ``imagesize.get(filepath: FileInput, *, exif_rotation: bool = True) -> tuple[int, int] ``
4276
4377 Returns image size as ``(width, height) ``. By default, orientation metadata is applied for rotated JPEG/TIFF images; pass ``exif_rotation=False `` to get the stored size as-is.
78+ On parsing errors it returns ``(-1, -1) ``.
4479
4580* ``imagesize.getDPI(filepath: FileInput) -> tuple[int, int] ``
4681
4782 Returns image DPI as ``(xdpi, ydpi) ``.
83+ On parsing errors it returns ``(-1, -1) ``.
4884
4985* ``imagesize.get_info(filepath: FileInput, *, size: bool = True, dpi: bool = True, colors: bool = True, exif_rotation: bool = True, channels: bool = True) -> ImageInfo ``
5086
0 commit comments