PIL Problem (Python Imaging Library)

Fredrik Lundh fredrik at pythonware.com
Tue Feb 1 05:54:37 EST 2000

Jerome ALET <alet at unice.fr> wrote:
> Does someone know if the standard PIL library can allow me to  extract
> many graphic files (JPEG in my case) from a special undocumented format 
> archive ?
> the only thing I know is the offset at which begins each jpeg file, but I
> don't know their sizes, and I don't want to analyze the jpeg format to
> finally discover the size (in fact I want PIL to do it for me).

something like this should work:

import Image, sys
from ContainerIO import ContainerIO

file = open(archivefile, "rb")

subimage = Image.open(ContainerIO(file, offset, sys.maxint))


<!-- (the eff-bot guide to) the standard python library:

More information about the Python-list mailing list