!30 added support for webp files
From: @wang--ge Reviewed-by: @caodongxia Signed-off-by: @caodongxia
This commit is contained in:
commit
ae055ff22b
28
0001-added-support-for-webp-files.patch
Normal file
28
0001-added-support-for-webp-files.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From b214d05c3899816d7f1f908145461453a6719ad2 Mon Sep 17 00:00:00 2001
|
||||
From: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com>
|
||||
Date: Fri, 29 Apr 2022 16:56:31 +0200
|
||||
Subject: [PATCH] added support for webp files
|
||||
|
||||
---
|
||||
imagesize.py | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/imagesize.py b/imagesize.py
|
||||
index f700f14..9e1960a 100644
|
||||
--- a/imagesize.py
|
||||
+++ b/imagesize.py
|
||||
@@ -249,6 +249,11 @@ def get(filepath):
|
||||
|
||||
fhandle.seek(-1, os.SEEK_CUR)
|
||||
width, height = sizes
|
||||
+ elif head.startswith(b"RIFF") and head[8:12] == b"WEBP":
|
||||
+ # enter VP8 chunk
|
||||
+ fhandle.seek(26)
|
||||
+ width = struct.unpack("<H", fhandle.read(2))[0]
|
||||
+ height = struct.unpack("<H", fhandle.read(2))[0]
|
||||
|
||||
finally:
|
||||
fhandle.close()
|
||||
--
|
||||
2.39.0.windows.2
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
Name: python-imagesize
|
||||
Version: 1.3.0
|
||||
Release: 3
|
||||
Release: 4
|
||||
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
|
||||
patch0001: 0001-added-support-for-webp-files.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-devel python3-pytest
|
||||
@ -20,7 +21,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
|
||||
%py3_build
|
||||
@ -34,6 +35,9 @@ py.test-3 --ignore=./test/test_get_filelike.py
|
||||
%{python3_sitelib}/*
|
||||
|
||||
%changelog
|
||||
* Tue Nov 28 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1.3.0-4
|
||||
- added support for webp files
|
||||
|
||||
* Tue Oct 25 2022 zhangruifang <zhangruifang1@h-partners.com> - 1.3.0-3
|
||||
- Rebuild for next release
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user