Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Cloud:OpenStack:Pike
python-Pillow
008-Ensure-previous-FLI-frame-is-loaded.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 008-Ensure-previous-FLI-frame-is-loaded.patch of Package python-Pillow
From 2f7f945c843c5d88c3fb6772536cce4e80c35622 Mon Sep 17 00:00:00 2001 From: Andrew Murray <radarhere@users.noreply.github.com> Date: Mon, 26 Nov 2018 18:52:51 +1100 Subject: [PATCH] Ensure previous FLI frame is loaded before seeking to the next --- Tests/test_file_fli.py | 7 +++++++ src/PIL/FliImagePlugin.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Tests/test_file_fli.py b/Tests/test_file_fli.py index 142af3cec4..2375d3749a 100644 --- a/Tests/test_file_fli.py +++ b/Tests/test_file_fli.py @@ -72,6 +72,13 @@ def test_seek_tell(self): layer_number = im.tell() self.assertEqual(layer_number, 2) + def test_seek(self): + im = Image.open(animated_test_file) + im.seek(50) + + expected = Image.open("Tests/images/a_fli.png") + self.assert_image_equal(im, expected) + if __name__ == '__main__': unittest.main() diff --git a/PIL/FliImagePlugin.py b/PIL/FliImagePlugin.py index c78c8c622d..b1eb9ae4df 100644 --- a/PIL/FliImagePlugin.py +++ b/PIL/FliImagePlugin.py @@ -153,6 +153,9 @@ def _seek(self, frame): self.__frame = -1 self.__fp.seek(self.__rewind) self.__offset = 128 + else: + # ensure that the previous frame was loaded + self.load() if frame != self.__frame + 1: raise ValueError("cannot seek to frame %d" % frame)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor