View Single Post
Old 09-15-2012, 04:13 AM   #11
a.l.e
Junior Member
a.l.e began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
indeed unzip -v gives:

Code:
$ unzip -v text_simple.epub 
Archive:  text_simple.epub
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
      20  Defl:N       25 -25% 1980-00-00 00:00 2cab616f  mimetype
which shows a size of 25 instead of 20 and a method as Defl:N instead of stored...

i've checked my call to zipOpenNewFileInZip -- which for simplicity was not supposed to ever compress a file -- and could figure out why in my example it says "Defl":

Code:
    if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_NO_COMPRESSION) != Z_OK)
changed to a/ use the compression flag and b/ not use Z_DEFLATED when no compression is selected:
Code:
    if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, (compression ? Z_DEFLATED : 0), (compression ? 8 : Z_NO_COMPRESSION)) != Z_OK)
the warning wen away and

Code:
$ unzip -v text_simple.epub 
Archive:  text_simple.epub
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
      20  Stored       20   0% 1980-00-00 00:00 2cab616f  mimetype
thanks for your help! your hints lead me to check the right thing!

i will commit the change before tomorrow if somebody wants to give a try...

ciao
a.l.e
a.l.e is offline   Reply With Quote