title: Convert images in a compressed file such as a zip file to numpy array in python
body: <p>We could combine module <code>zipfile.ZipFile</code> and <code>PIL.Image.open</code> to read the image from the compressed file. However, we might receive an error <code>io.UnsupportedOperation: seek</code> after we call <code>PIL.Image.open</code>. It refers to the condition that I passed a <code>ZipExtFile</code> object to <code>PIL.Image.open</code> function as below:</p>
  
  <pre><code> from zipfile import ZipFile
   from PIL import Image
  
   zipf = ZipFile(path, "r")
  
   f = zipf.open("test.jpg")
  
   img = Image.open(f)
  </code></pre>
  
  <p>So, how to fix the problem?</p>