compression

Mac OS X 'compress' option vs command line zip (why do they produce different results?)

孤街浪徒 提交于 2019-11-28 12:06:59
I noticed that the command line 'zip' tool and Mac OS X's 'Compress XXX' option (available via right click in finder) are giving different output files. Not only is the size of the file a few hundred bytes bigger but the content is significantly different as well. How can I find out what command the Finder is using for compression? Take a look at An AppleScript to compress a Finder selection article. try tell application "Finder" set theSelection to the selection set selectionCount to count of theSelection if selectionCount is greater than 1 then error "Please select only one Finder item

How to extract zip file contents into a folder in .NET 4.5

☆樱花仙子☆ 提交于 2019-11-28 12:03:57
问题 The following question's answer seems to outline how to extract files using the System.IO.Commpression.ZipFile.ExtractToDirectory method invocation. "ZipFile" doesn't seem to exist in .NET 4.5, when adding a reference to System.IO.Compression. How can I extract files from a *.zip file in .NET 4.5? How to Unzip all .Zip file from Folder using C# 4.0 and without using any OpenSource Dll? This seems to show how to compress files. But I'm looking for the reverse. Zipping files in .NET 4.5 Even

how to compress a PNG image using Java

妖精的绣舞 提交于 2019-11-28 11:58:59
Hi I would like to know if there is any way in Java to reduce the size of an image (use any kind of compression) that was loaded as a BufferedImage and is going to be saved as an PNG. Maybe some sort of png imagewriteparam? I didnt find anything helpful so im stuck. heres a sample how the image is loaded and saved public static BufferedImage load(String imageUrl) { Image image = new ImageIcon(imageUrl).getImage(); bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB); Graphics2D g2D = bufferedImage.createGraphics(); g2D.drawImage(image, 0,

Compass, config.rb and getting the output actually :compressed

一世执手 提交于 2019-11-28 11:54:19
问题 This is my config.rb preferred_syntax = :sass http_path = '/' css_dir = 'css' sass_dir = 'sass' images_dir = 'assets/images' javascripts_dir = 'js' relative_assets = true line_comments = false output_style = :compressed The thing is that the code won't be compressed, sample of few blocks: /* line 37, ../sass/style.scss */ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { color: #363636; } /* line 37, ../sass/style.scss */ .ui-state

How to extract ZIP file in C#

和自甴很熟 提交于 2019-11-28 11:12:17
How can I extract a ZIP file using C#? BlindingDawn DotNetZip : class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files... DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, or any scripting environment. DotNetZip supports these scenarios: a Silverlight app that dynamically creates zip files. an ASP.NET app that dynamically creates ZIP files and allows a browser to download them a Windows

Reducing color depth in an image is not reducin the file size?

和自甴很熟 提交于 2019-11-28 10:53:10
问题 I use this code to reduce the depth of an image: public void ApplyDecreaseColourDepth(int offset) { int A, R, G, B; Color pixelColor; for (int y = 0; y < bitmapImage.Height; y++) { for (int x = 0; x < bitmapImage.Width; x++) { pixelColor = bitmapImage.GetPixel(x, y); A = pixelColor.A; R = ((pixelColor.R + (offset / 2)) - ((pixelColor.R + (offset / 2)) % offset) - 1); if (R < 0) { R = 0; } G = ((pixelColor.G + (offset / 2)) - ((pixelColor.G + (offset / 2)) % offset) - 1); if (G < 0) { G = 0; }

GZipStream and decompression

最后都变了- 提交于 2019-11-28 09:58:50
I have code that should do the compression: FileStream fs = new FileStream("g:\\gj.txt", FileMode.Open); FileStream fd = new FileStream("g:\\gj.zip", FileMode.Create); GZipStream csStream = new GZipStream(fd, CompressionMode.Compress); byte[] compressedBuffer = new byte[500]; int offset = 0; int nRead; nRead = fs.Read(compressedBuffer, offset, compressedBuffer.Length); while (nRead > 0) { csStream.Write(compressedBuffer, offset, nRead); offset = offset + nRead; nRead = fs.Read(compressedBuffer, offset, compressedBuffer.Length); } fd.Close(); fs.Close(); and I think it does, but I want to

Unzipping zip archives with JavaScript in Firefox 3.6

落爺英雄遲暮 提交于 2019-11-28 09:28:26
I am toying with an application that will demo some Firefox 3.6 specific functionality, most of which are listed here: http://demos.hacks.mozilla.org/openweb/ I want to drag a zip file in the browser, unzip it, and work with the unzipped contents. Are there any existing libraries that can do this? Does FireFox 3.6 in particular have something I can use? Or would I have to roll my own unzipper library? For the record: http://github.com/augustl/js-unzip There are existing libraries, here is one (as an example): http://code.google.com/p/jslibs/ 来源: https://stackoverflow.com/questions/2163857

How to enable IIS compression for WCF services?

别来无恙 提交于 2019-11-28 09:18:51
I currently use a custom gzip encoder for my WCF service. I want to replace it with the built-in IIS 7 compression if that is possible. I can't find info online on how to that. Is there any way to enable IIS 7 compression for WCF services? Do you know if this will be supported out-of-the-box with .Net 4? Edit June 15th: I'm still looking for a way to replace our custom gzip encoder with a mainstream approach so if you know how to do that with .Net 4 and IIS 7, please answer this question. Thanks Sidebar : My attempt at doing this manually Since I can't find how to do it by simply turning a few

Is it possible to reload a specific image if it did not finish loading after a preset amount of time? javascript/jquery

≡放荡痞女 提交于 2019-11-28 09:03:46
问题 I am running a online photography portfolio and sometimes, 1 or 2 images on a page fails to load. and refreshing will display the failed to load image. Scenario: I click on the link and the images start to load. but the page never finishes loading because one of the images fails to load. After a refresh, the browser loads the failed image as a good image. Only a ctrl+F5 can clear the cached failed image. Planned solution: I want to detected images that did not finish loading after 10secs and