After file extraction, file content of some files is different

Feb 18, 2008 at 12:48 PM
Edited Feb 18, 2008 at 12:54 PM
Hi,

I created a .zip file (using a third party zipper) which contains 2044 files. After extracting the zip file using ExtractAll(), I noticed I was not able to open 9 files correctly; The images (.jpg files) could not be rendered anymore. Extracting the files with WinZip 8.0 resulted in no problems at all. All files could be rendered correctly...
The mysterious 9 files had the same compressed and uncompressed size (in bytes) but had the compression method 'deflated' in the Winzip properties. After recreating the zip-file using Winzip 8.0 I noticed the file could now be extracted correctly by DotNetZip, and the zip-properties are slightly different now. Because Winzip is able to extract the original file succesfully, I think this exceptional situation is not handled correctly by the DotNet Zip Library.

The detailed file properties of one of the original files (not extractable) and the recreated one (extractable) are noted below. (These file properties were rendered in Winzip 8.0)

Your thoughts on this subject are most welcome.

Greetz

ORIGINAL FILE PROPERTIES:

part number in which file begins (00): part 1
relative offset of local header: 5477215 (0x0053935f) bytes
version made by operating system (00): MS-DOS, OS/2, NT FAT
version made by zip software (45): 4.5
operat. system version needed to extract (00): MS-DOS, OS/2, NT FAT
unzip software version needed to extract (20): 2.0
general purpose bit flag (0x0000) (bit 15..0): 0000.0000 0000.0000
file security status (bit 0): not encrypted
extended local header (bit 3): no
compression method (08): deflated
compression sub-type (deflation): normal
file last modified on (0x00003690 0x00005c97): 2007-apr-16 11:36:46
32-bit CRC value: 0x7f4a722c
compressed size: 69 bytes
uncompressed size: 69 bytes
length of filename: 33 characters
length of extra field: 0 bytes
length of file comment: 0 characters
internal file attributes: 0x0000
apparent file type: binary
external file attributes: 0x00000021
non-MSDOS external file attributes: 0x000000
MS-DOS file attributes (0x21): rdo arc
Current Location part 1 offset 10214503
filename:website\images\sortdescending.gif
Current Location part 1 offset 10214536
Central directory entry PK0102 (4+42): #1398

RECREATED FILE PROPERTIES:

part number in which file begins (00): part 1
relative offset of local header: 5524860 (0x00544d7c) bytes
version made by operating system (00): MS-DOS, OS/2, NT FAT
version made by zip software (20): 2.0
operat. system version needed to extract (00): MS-DOS, OS/2, NT FAT
unzip software version needed to extract (10): 1.0
general purpose bit flag (0x0000) (bit 15..0): 0000.0000 0000.0000
file security status (bit 0): not encrypted
extended local header (bit 3): no
compression method (00): none (stored)
file last modified on (0x00003690 0x00005c97): 2007-apr-16 11:36:46
32-bit CRC value: 0x7f4a722c
compressed size: 69 bytes
uncompressed size: 69 bytes
length of filename: 33 characters
length of extra field: 0 bytes
length of file comment: 0 characters
internal file attributes: 0x0000
apparent file type: binary
external file attributes: 0x81240021
non-MSDOS external file attributes: 0x812400
MS-DOS file attributes (0x21): rdo arc
Current Location part 1 offset 10279536
filename:website\images\sortdescending.gif
Current Location part 1 offset 10279569
Central directory entry PK0102 (4+42): #1397
Coordinator
Feb 18, 2008 at 1:57 PM
if you send me a zip created by the third-party zipper, that exhibits this behavior, I will be ale to look at it.
what's the third-party thing?

I don't want all 2044 files. I just want a zip with the 9 that fail.

thanks
Feb 20, 2008 at 7:03 AM
Thanks for your quick reply. I posted my response with attachment in an 'Issue Tracker' topic with the same title. If you have any questions, don't hesitate to ask.

With regards.
Mar 4, 2008 at 1:24 PM
Hi,

Could you please give me an update on this issue?

Thnx
Apr 18, 2008 at 8:21 PM
Along these same lines (dealing with compressed files being added to a ZipFile) I added a .jpg as a ZipEntry and it extracts just fine with code if I use ZipFile.ExtractAll(). However, if I call ZipFile.Save("c:\somewhere\foo.zip") and try to unzip it with WinZip or WinRar, it says the .jpg file is corrupt.
Coordinator
Apr 19, 2008 at 8:52 AM
Edited Apr 19, 2008 at 8:53 AM
RVeldhuis, I reproduced the original problem, and fixed it.
see change set 16914.