Added return types to docstrings, and fixed description of getDPI()'s¡­

Signed-off-by: zhang-liang-pengkun <zhangliangpengkun@xfusion.com>
This commit is contained in:
zhang-liang-pengkun 2023-10-19 11:12:34 +08:00
parent 86f062ccba
commit 248c5e3d45
2 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,36 @@
From 2f73f20f73cfe097d6838b45eee22cb300d9cc04 Mon Sep 17 00:00:00 2001
From: Tyler Young <tyler@x-plane.com>
Date: Tue, 27 Aug 2019 12:43:35 -0500
Subject: [PATCH] Added return types to docstrings, and fixed description of
getDPI()'s return
---
imagesize.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/imagesize.py b/imagesize.py
index 2717240..b0fbfb2 100644
--- a/imagesize.py
+++ b/imagesize.py
@@ -56,6 +56,7 @@ def get(filepath):
"""
Return (width, height) for a given img file content
no requirements
+ :rtype Tuple[int, int]
"""
height = -1
width = -1
@@ -153,8 +154,9 @@ def get(filepath):
def getDPI(filepath):
"""
- Return (width, height) for a given img file content
+ Return (x DPI, y DPI) for a given img file content
no requirements
+ :rtype Tuple[int, int]
"""
xDPI = -1
yDPI = -1
--
2.39.0.windows.2

View File

@ -1,10 +1,11 @@
Name: python-imagesize
Version: 1.1.0
Release: 1
Release: 2
Summary: This module analyzes image headers and returns image size.
License: MIT
URL: https://github.com/shibukawa/imagesize_py
Source0: https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-%{version}.tar.gz
Patch01: 0001-Added-return-types-to-docstrings-and-fixed-descripti.patch
BuildArch: noarch
BuildRequires: python2-setuptools python2-devel python2-pytest python3-setuptools
BuildRequires: python3-devel python3-pytest
@ -27,7 +28,7 @@ Summary: This module analyzes image headers and returns image size.
This module analyzes JPEG/JPEG 2000/PNG/GIF/TIFF image headers and returns image size.
%prep
%autosetup -n imagesize-%{version}
%autosetup -n imagesize-%{version} -p1
rm -rf imagesize.egg-info
%build
%py2_build
@ -48,6 +49,10 @@ py.test-3
%{python3_sitelib}/*
%changelog
* Thu Oct 19 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1.1.0-2
- Added return types to docstrings, and fixed description of getDPI()'s…
* Tue Aug 04 2020 Yeqing Peng <pengyeqing@huawei.com> - 1.1.0-1
- update to 1.1.0