[
  {
    "Id": "254740",
    "ThreadId": "74466",
    "Html": "<p>Hi all,</p>\r\n<p>Im trying to zip a directory into&nbsp;a zip file.</p>\r\n<p>The output zip file's size doesn't change, although Im</p>\r\n<p>changing the&nbsp;<span style=\"font-size:x-small\">CompressionLevel from 0 to 9.</span></p>\r\n<p><span style=\"font-size:x-small\">Here is the relevant code:(VB.Net 2005)</span></p>\r\n<p><span style=\"color:#ff0000\">----------------------------------------------------------------------------</span></p>\r\n<p>Using zip As New ZipFile()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.StatusMessageTextWriter = System.Console.Out<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.AddDirectory(&quot;C:\\Temp\\&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.CompressionLevel = Ionic.Zlib.CompressionLevel.<span style=\"color:#ff0000\"><strong>Level1</strong></span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Never<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.Save(&quot;C:\\1.zip&quot;)</p>\r\n<p>End Using</p>\r\n<p><span style=\"color:#ff0000\">----------------------------------------------------------------------------</span></p>\r\n<p><span style=\"color:#000000\">Does anyone know what am I missing here?</span></p>\r\n<p><span style=\"color:#000000\">Thanks anayway.</span></p>\r\n<p><span style=\"color:#000000\">Ofer</span></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><span style=\"color:#0000ff;font-size:x-small\"></span></p>",
    "PostedDate": "2009-11-08T07:29:37.863-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254745",
    "ThreadId": "74466",
    "Html": "<p>yes.</p>\r\n<p>from <a href=\"http://cheeso.members.winisp.net/DotNetZipHelp/html/87d7a7f4-203c-22a0-b7c1-c94ed62e2ba7.htm\">the doc</a>:</p>\r\n<p style=\"padding-left:30px\">As with some other properties on the <span>ZipFile</span> class, like <a href=\"http://dotnetzip.codeplex.com/Thread/4444d7a5-3324-8af9-3ed3-5bf6551d3cd1.htm\">Password</a>, <a href=\"http://dotnetzip.codeplex.com/Thread/5fd9508d-1a0a-8989-e287-4d941d5a2565.htm\">Encryption</a>, and <a href=\"http://dotnetzip.codeplex.com/Thread/a0ba84a0-0dbd-7578-636a-35ce28e65192.htm\">ZipErrorAction</a>, setting this property on a <span>ZipFile</span> instance will cause the specified <span>CompressionLevel</span> to be used on all <a href=\"http://dotnetzip.codeplex.com/Thread/6c55db80-ec01-c606-be38-2ea91a64df15.htm\">ZipEntry</a> items that are subsequently added to the <span>ZipFile</span> instance. If you set this property after you have added items to the <span>ZipFile</span>, but before you have called <span>Save()</span>, those items will not use the specified compression level.</p>\r\n<p>Try this:</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>Using zip As New ZipFile()\r\n            zip.StatusMessageTextWriter = System.Console.Out\r\n            zip.CompressionLevel = Ionic.Zlib.CompressionLevel.Level1\r\n            zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Never\r\n            zip.AddDirectory(&quot;C:\\Temp\\&quot;)\r\n            zip.Save(<span style=\"color:#A31515\">&quot;C:\\1.zip&quot;</span>)\r\nEnd Using\r\n\r\n</pre>\r\n</div>",
    "PostedDate": "2009-11-08T07:59:22.027-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254905",
    "ThreadId": "74466",
    "Html": "<p>Hi Cheeso,</p>\r\n<p>I'd tryed it, but it doesn't change the compression or file size.</p>\r\n<p>My problem remains the same.</p>\r\n<p>Thanks</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-11-08T22:03:19.84-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254907",
    "ThreadId": "74466",
    "Html": "<p>What are you compressing, exactly?&nbsp; If it's previously compressed, it won't compress any further.</p>",
    "PostedDate": "2009-11-08T22:05:32.313-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254914",
    "ThreadId": "74466",
    "Html": "<p>Today we are using WinZip for each directory</p>\r\n<p>we want to zip inorder to send it to our&nbsp;customers.</p>\r\n<p>We wanted to develop a .net app so we wont have to</p>\r\n<p>zip it with WinZip for each customer.</p>\r\n<p>The dir contains a few jpg's &amp; Tifs.</p>\r\n<p>The customer has an old program that uses cmd to unzip the file:</p>\r\n<p><span lang=en-us><span style=\"font-family:Calibri;color:#000000\"><span style=\"font-family:Arial;color:#0000ff;font-size:x-small\">UNZIP -s -o NewZipFile.Zip -d C:\\Temp</span></span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">We see different sizes between the old winZip file and the new zip file.</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">Also we see different outputs when the customer runs the commandline:</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">The old file (using WinZip) - the output writes: Inflating......</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">The new file (using Ionic) - the output writes: Extracting.......</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">I read that the difference is because the new file is not compressed,</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">so thats why I want to know how to make the compressionlevel to work.</span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\"><span lang=en-us><span style=\"color:#000000\">Hope I'm more clear now,</span></span></span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\"><span lang=en-us><span style=\"color:#000000\">Ofer</span></span></span></span></p>\r\n<p><span lang=en-us><span style=\"color:#000000\">&nbsp;</span></span></p>",
    "PostedDate": "2009-11-08T22:36:47.75-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254936",
    "ThreadId": "74466",
    "Html": "<p>Yes, more clear, thanks.</p>\r\n<p>Here's an idea: In the older version of the library, there was a heuristic that always applied a CompressionLevel.None for some document types.&nbsp; I think that included .jpg files.</p>\r\n<p>What version of the library are you using?&nbsp; Have you tried v1.9?&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-11-09T00:07:15.923-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254942",
    "ThreadId": "74466",
    "Html": "<p>It wokrs!!!!</p>\r\n<p>Thank you very much Cheeso.</p>\r\n<p>I was using v 1.8. The problem was solved after updrading to v1.9.</p>\r\n<p>You were right about changing the compression level before</p>\r\n<p>adding the the directory. I tryed to change the order and it doesn't work.</p>\r\n<p>The following code Works great:</p>\r\n<p>zip.CompressionLevel = Ionic.Zlib.CompressionLevel.Level1<br>zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Never<br>zip.AddDirectory(&quot;C:\\Temp\\&quot;)<br>zip.Save(<span style=\"color:#a31515\">&quot;C:\\1.zip&quot;</span>)</p>\r\n<p>Thank again!!!!!</p>\r\n<p>(-',</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-11-09T00:50:11.017-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "254972",
    "ThreadId": "74466",
    "Html": "<p>Great!&nbsp; Glad it works for you.</p>\r\n<p>Good luck to you.</p>\r\n<p>ps: do me a favor, if you can.&nbsp; Rate the release at this link:</p>\r\n<p><a href=\"http://dotnetzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27890\">http://dotnetzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27890</a></p>\r\n<p>(Scroll down to the bottom of the page to see the ratings button)</p>",
    "PostedDate": "2009-11-09T02:12:03.52-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]