archive icon indicating copy to clipboard operation
archive copied to clipboard

Make correct docx after working with it as zip archive?

Open bubnenkoff opened this issue 9 years ago • 3 comments

http://stackoverflow.com/questions/29593676/how-to-make-correct-docx-after-working-with-it-as-zip-archive

bubnenkoff avatar Apr 13 '15 03:04 bubnenkoff

it's look like crc after adding files to archive are not updates.

bubnenkoff avatar Apr 13 '15 14:04 bubnenkoff

CRCs are being recomputed from an initial value of 0.

After some research it seems it needs to use a different initial value.

I'll try to get this fixed up today.

rcythr avatar Apr 13 '15 15:04 rcythr

The crc is recalculated automatically when the data is set into the file object. See https://github.com/rcythr/archive/blob/master/source/archive/zip.d#L185

After doing some digging I have determined that the call to std.zlib.crc32 is being called correctly as-is -- at least it's being called in the same way that python's zip module is calling their crc function.

When I wrote this module none of my archival tools complained about invalid crc values. If you discover the root of this problem please feel free to let me know or write a patch for it.

rcythr avatar Apr 14 '15 04:04 rcythr