<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Eirik,
<div><br>
</div>
<div>I think this proposal has merit.</div>
<div><br>
</div>
<div>Outside of info-zip, are you aware of any other zip tool that does something similar?  7zip, WinZip and compress do not appear to offer similar functionality.</div>
<div>
<div><br>
<blockquote type="cite">
<div>On Dec 16, 2024, at 6:38 AM, Eirik Bjørsnøs <eirbjo@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">Hi,<br>
<div><br>
</div>
<div>I would like to socialize the idea of adding a new option to the jar tool to disable ZIP compression for selected file extensions.</div>
<div><br>
</div>
<div>The jar tool currently supports disabling ZIP compression altogether for an archive using the -0 --no-compress options.</div>
<div><br>
</div>
<div>However, different file types have different compression characteristics. Already compressed files such as JPEG, PNG have little to gain by deflate compression, and the compression and decompression of such files is mostly a waste of effort. The same is
 true for archive formats such as ZIP, JAR, GZ etc.</div>
<div><br>
</div>
<div>I propose that we add a new option, tentatively named "--no-compress-ext", which would take a colon-separated list of file extensions to disable ZIP compression for:</div>
<div><br>
</div>
<div><font face="monospace">jar --create --file archive.jar --no-compress-ext=.jpg:.png:.gz -C dir .</font></div>
<div><br>
</div>
<div>This would work similarly to the zip -n option, see zip --help:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<font face="monospace">-n   don't compress these suffixes</font></blockquote>
<div><br>
</div>
<div>In context, the jar --help command could look something like this:</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<font face="monospace">  -0, --no-compress          Store only; use no ZIP compression<br>
      --no-compress-ext=EXT  Disable compression for selected file extensions,<br>
                             e.g. "--no-compress-ext=.zip:.jar:.jpg:.png"</font></blockquote>
</div>
<div><br>
</div>
<div>I specifically do not suggest that we should define any kind of default for this option. This should be entirely up to the user.</div>
<div><br>
</div>
<div>Feedback on this proposal is welcome. (I have a draft implementation around, but let's focus on the merits of the proposal before we dive into any code)</div>
<div><br>
</div>
<div>Eirik.</div>
</div>
</div>
</blockquote>
</div>
<br>
<div><span><img alt="oracle_sig_logo.gif" src="cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC@home"></span>
<div dir="auto" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div><br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
<br>
<br>
<br>
Lance Andersen | Principal Member of Technical Staff | +1.781.442.2037</div>
<div>Oracle Java Engineering <br>
1 Network Drive <br>
Burlington, MA 01803<br>
Lance.Andersen@oracle.com</div>
</div>
<br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">
<br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">
</div>
<br>
</div>
</body>
</html>