compression

How does Google's Page Speed lossless image compression work?

陌路散爱 提交于 2019-11-27 05:49:14
When you run Google's PageSpeed plugin for Firebug/Firefox on a website it will suggest cases where an image can be losslessly compressed, and provide a link to download this smaller image. For example: Losslessly compressing http://farm3.static.flickr.com/2667/4096993475_80359a672b_s.jpg could save 33.5KiB (85% reduction). Losslessly compressing http://farm2.static.flickr.com/1149/5137875594_28d0e287fb_s.jpg could save 18.5KiB (77% reduction). Losslessly compressing http://cdn.uservoice.com/images/widgets/en/feedback_tab_white.png could save 262B (11% reduction). Losslessly compressing http:/

Compressing a web service response for jQuery

落花浮王杯 提交于 2019-11-27 05:48:20
问题 I'm attempting to gzip a JSON response from an ASMX web service to be consumed on the client-side by jQuery. My web.config already has httpCompression set like so: (I'm using IIS 7) <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" staticCompressionDisableCpuUsage="90" staticCompressionEnableCpuUsage="60" dynamicCompressionDisableCpuUsage="80" dynamicCompressionEnableCpuUsage="50"> <dynamicTypes> <add mimeType="application/javascript" enabled="true"/> <add

compression algorithm for sorted integers

守給你的承諾、 提交于 2019-11-27 05:47:32
问题 I have a large sequence of random integers sorted from the lowest to the highest. The numbers start from 1 bit and end near 45 bits. In the beginning of the list I have numbers very close to each other: 4, 20, 23, 40, 66. But when the numbers start to get higher the distance between them is a bit higher too (actually the distance between them is aleatory). There are no duplicated numbers. I'm using bit packing to save some space. Nonetheless, this file can get really big. I would like to know

.NET GZipStream compress and decompress

China☆狼群 提交于 2019-11-27 05:43:20
问题 What is wrong with this code below. I always get FALSE, meaning after compression, decompressed data does not match original value. public static bool Test() { string sample = "This is a compression test of microsoft .net gzip compression method and decompression methods"; System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] data = encoding.GetBytes(sample); bool result = false; //Compress MemoryStream cmpStream; cmpStream = new MemoryStream(); GZipStream hgs = new

Is there a built-in zip library in .NET 3.5?

混江龙づ霸主 提交于 2019-11-27 05:32:27
问题 Is there a built-in zip library in .NET 3.5? If not, what are the popular open source .net zip libraries. 回答1: There is no built-in library. There are open-source options. DotNetZip is one. Simple, easy to use. It has good features: AES Encryption, regular encryption, streams, ZIP64, file comments, Unicode, progress events, more. And it's free and open source. Here's some sample code. // extract all Photoshop files larger than 100mb using (ZipFile zip1 = ZipFile.Read(ZipFileName)) { var

Image compression like Whatsapp and other messengers on Android

▼魔方 西西 提交于 2019-11-27 05:25:57
问题 I am using the following code for image compression. The code compresses image files that are larger than 2 MB. But this code takes time and image quality stays pure. public static String compressImage(String imagePath, Context context) { String resizeImagePath = null; String filePath = imagePath; CustomLogHandler.printDebug(TAG, "resizeImagePath:" + imagePath); Bitmap scaledBitmap = null; int imageScal = 1; // File size greater then 2mb DecimalFormat df = new DecimalFormat("0.00"); File

Steganography in lossy compression (JAVA)

允我心安 提交于 2019-11-27 05:22:41
I have this for encoding data in jpeg images in java. I am converting the text to its binary form and insert it to the LSB (depending on what the user has chosen.1,2,3,4) of the RGB in each pixel from (0,0) till (width,height). outer: for(int i = 0; i < height; i++){ for(int j = 0; j < width; j++){ Color c = new Color(image.getRGB(j, i)); int red = binaryToInteger(insertMessage(integerToBinary((int)(c.getRed())),numLSB)); int green = binaryToInteger(insertMessage(integerToBinary((int)(c.getGreen())),numLSB)); int blue = binaryToInteger(insertMessage(integerToBinary((int)(c.getBlue())),numLSB))

how to config grunt.js to minify files separately

北城余情 提交于 2019-11-27 05:01:53
问题 there are some js files in static/js/ 1. a.js 2. b.js 3. c.js how to config grunt.js to get below files: 1. a.min.js 2. b.min.js 3. c.min.js as far, I have to type specific file name: min: { dist: { src: 'js/**/*.js', dest: 'js/min/xxx.min.js' } } 回答1: Had the same problem and found a solution that would automatically minify all my scripts separately: uglify: { build: { files: [{ expand: true, src: '**/*.js', dest: 'build/scripts', cwd: 'app/scripts' }] } } 回答2: In grunt 0.4 you can specify

Inno Setup - How to add cancel button to decompressing page?

主宰稳场 提交于 2019-11-27 04:44:23
问题 I am using this code: How to add .arc decompression to Inno Setup? (answer of Martin Prikryl). I want to add a cancel button at decompressing page and active this page for others functions (when the decompression is active, this page is inactive and, for example, i can not press on/off button of my music implementation). How to add a cancel button to decompression page? and how to active this page for others functions? 回答1: I have reimplemented the solution from How to add .arc decompression

Uncompress BZIP2 archive

旧时模样 提交于 2019-11-27 04:29:44
问题 I can uncompress zip, gzip, and rar files, but I also need to uncompress bzip2 files as well as unarchive them (.tar). I haven't come across a good library to use. I am using Java along with Maven so ideally, I'd like to include it as a dependency in the POM. What libraries do you recommend? 回答1: The best option I can see is Apache Commons Compress with this Maven dependency. <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.0</version> <