def getchunks(im, **params):
 class collector(object, ):
  data = []
  def write(self, data):
   pass
  def append(self, chunk):
   self.data.append(chunk)
 def append(fp, cid, *data):
  data = ''.join(data)
  (hi, lo) = Image.core.crc32(data, Image.core.crc32(cid))
  crc = (o16(hi) + o16(lo))
  fp.append((cid, data, crc))
 fp = collector()
 try:
  im.encoderinfo = params
  _save(im, fp, None, append)
 finally:
  del im.encoderinfo
 return fp.data

def getchunks ( im , ** params ) : class collector ( object , ) : data = [ ] def write ( self , data ) : pass def append ( self , chunk ) : self . data . append ( chunk ) def append ( fp , cid , * data ) : data = '' . join ( data ) ( hi , lo ) = Image . core . crc32 ( data , Image . core . crc32 ( cid ) ) crc = ( o16 ( hi ) + o16 ( lo ) ) fp . append ( ( cid , data , crc ) ) fp = collector ( ) try : im . encoderinfo = params _save ( im , fp , None , append ) finally : del im . encoderinfo return fp . data
return a list of png chunks representing this image .