2

I have a bunch of timestamped .jpgs in a zip file, and when I open that zip file using Python's ZipFile package, I see three files:

>>> cameraZip = zipfile.ZipFile(zipPath, 'r')
>>> cameraZip.namelist()
['20131108_200152.jpg', '20131108_203158.jpg', '20131108_205521.jpg']

When I unpack the file using Mac OSX's default .zip unexpander, I get 371 files, from '20131101_000159.jpg' up to '20131108_193152.jpg'.

Unzipping this file gives the same result as the .zip unexpander:

$ unzip 2013.11.zip

extracting: 20131101_000159.jpg     
extracting: 20131101_003156.jpg 
...
extracting: 20131108_190155.jpg     
extracting: 20131108_193152.jpg 

Anybody have any idea what's going on?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Austin A.
  • 158
  • 5

1 Answers1

0

Most likely the problem is in zip central directory record, which wasn't correctly flushed when zip file was created. While Python looks for central directory (I guess), other implementations process local file headers and found all of them.

Nickolay Olshevsky
  • 13,706
  • 1
  • 34
  • 48