Use the 'compressed' metadata element to determine whether to offer a compressed...
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 7 Jan 2010 21:06:30 +0000 (14:06 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 8 Jan 2010 19:45:46 +0000 (12:45 -0700)
imp/lib/Contents.php

index 59c9db1..57792b6 100644 (file)
@@ -681,9 +681,11 @@ class IMP_Contents
          * than 200 KB. */
         if ($is_atc &&
             $download_zip &&
-            ($part['bytes'] > 204800) &&
-            !in_array($mime_type, array('application/zip', 'application/x-zip-compressed'))) {
-            $part['download_zip'] = $this->linkView($mime_part, 'download_attach', null, array('class' => 'downloadZipAtc', 'dload' => true, 'jstext' => sprintf(_("Download %s in .zip Format"), $mime_part->getDescription(true)), 'params' => array('zip' => 1)));
+            ($part['bytes'] > 204800)) {
+            $viewer = Horde_Mime_Viewer::factory($mime_part, $mime_type);
+            if (!$viewer->getMetadata('compressed')) {
+                $part['download_zip'] = $this->linkView($mime_part, 'download_attach', null, array('class' => 'downloadZipAtc', 'dload' => true, 'jstext' => sprintf(_("Download %s in .zip Format"), $mime_part->getDescription(true)), 'params' => array('zip' => 1)));
+            }
         }
 
         /* Display the image save link if the required registry calls are