Skip to content

Add SeekableImageFile - #10301

Open
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:seekable
Open

radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:seekable

Conversation

@radarhere

Copy link
Copy Markdown
Member

See what you think of this idea - instead of

class ImageFile:
  def _seek_check(self, frame):
    # Check if the user is seeking outside the sequence, or to the same frame

class GifImageFile(ImageFile):
  def seek(self, frame):
	if not self._seek_check(frame):
      return
    # Continue on with seek

what if we didn't have to repeat that check in each plugin's code?

class ImageFile:
  pass

class SeekableImageFile(ImageFile):
  def seek(self, frame):
    # Check if the user is seeking outside the sequence, or to the same frame
    
    self._seekTo(frame)

  @abc.abstractmethod
  def _seekTo(self, frame):
    pass

class GifImageFile(SeekableImageFile):
  def _seekTo(self, frame):
    # Seek

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant