compression

Tomcat JSR356 Websocket - disable permessage-deflate compression

早过忘川 提交于 2019-11-29 15:07:26
I'm, working on a Java servlet which runs on a Tomcat 8.0.18 server and uses the JSR356 websocket API to communicate with a browser. By default Tomcat uses the "permessage-deflate" compression to compress the websocket messages in both directions. I want to use no websocket compression, how can it be turned off? I have tried to use the compression="off" option in the file server.xml but that didn't change anything. How can i turn it off? Please try to add jvm option -Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true to catalina.bat (for windows) or catalina.sh (for unix like OS). e

Software for creating PNG 8bit transparent images?

醉酒当歌 提交于 2019-11-29 14:39:37
问题 I'm looking for software to create PNG8 format transparent images as per this article. NOTE: I need a linux solution myself, but please submit answers for other OSes. 回答1: pngquant does a good job of converting to PNG8 while preserving full transparency. If you're size-conscious, you may also be interested in pngcrush, which can usually (losslessly) compress PNGs quite a bit. 回答2: I also needed a Linux solution and found pngnq to do a pretty good job. It seems to be designed specifically for

How to decompress gzipstream with zlib

一曲冷凌霜 提交于 2019-11-29 14:35:45
Can someone tell me which function I need to use in order to decompress a byte array that has been compressed with vb.net's gzipstream. I would like to use zlib. I've included the zlib.h but I haven't been able to figure out what function(s) I should use. You can take a look at The Boost Iostreams Library : #include <fstream> #include <boost/iostreams/filtering_stream.hpp> #include <boost/iostreams/filter/gzip.hpp> std::ifstream file; file.exceptions(std::ios::failbit | std::ios::badbit); file.open(filename, std::ios_base::in | std::ios_base::binary); boost::iostreams::filtering_stream<boost:

How to reduce the size of an sqlite3 database for iphone?

冷暖自知 提交于 2019-11-29 14:25:04
问题 edit: many thanks for all the answers. Here are the results after applying the optimisations so far: Switching to sorting the characters and run length encoding - new DB size 42M Dropping the indexes on the booleans - new DB size 33M The really nice part is this hasn't required any changes in the iphone code I have an iphone application with a large dictionary held in sqlite format (read only). I'm looking for ideas to reduce the size of the DB file, which is currently very large. Here is the

How does ASP.NET vNext handle Caching, Compression & MimeMap in config.json?

若如初见. 提交于 2019-11-29 13:48:10
In previous versions all of these settings could be added and tweaked in the Web.Config file using something like the code below: <staticContent> <mimeMap fileExtension=".webp" mimeType="image/webp" /> <!-- Caching --> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="96:00:00" /> </staticContent> <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript

Compress directory to tar.gz with Commons Compress

戏子无情 提交于 2019-11-29 13:34:47
问题 I'm running into a problem using the commons compress library to create a tar.gz of a directory. I have a directory structure that is as follows. parent/ child/ file1.raw fileN.raw I'm using the following code to do the compression. It runs fine without exceptions. However, when I try to decompress that tar.gz, I get a single file with the name "childDirToCompress". Its the correct size so the files have clearly been appended to each other in the tarring process. The desired output would be a

How to Enable GZIP compression on Play Framework 1 app on Heroku Cedar?

余生颓废 提交于 2019-11-29 12:44:22
问题 I'd like to enable GZIP compression for public assets and HTTP responses for performance. My site has a lot of mobile access. As far as I can tell, there is nothing built into Play Framework to support this, and Heroku doesn't seem to have a solution either. What is the best way to start getting some compression on my app? 回答1: Check out: https://gist.github.com/1317626 回答2: Ok I've had a go at minifying and gzipping all STATIC resources - nobody seems to have attempted this yet. Play

Compressing text before storing it in the database

二次信任 提交于 2019-11-29 12:29:58
问题 I need to store a very big amount of text in mysql database. It will be millions of records with field type LONGTEXT and database size will be huge. So, I want ask, if there is a safe way to compress text before storing it into TEXT field to save space, with ability to extract it back if needed? Something like: $archived_text = compress_text($huge_text); // saving $archived_text to database here // ... // ... // getting compressed text from database $archived_text = get_text_from_db(); $huge

UIImage to raw NSData / avoid compression

淺唱寂寞╮ 提交于 2019-11-29 12:18:59
I have my own image downloader class, it holds a queue and downloads images one (or a certain amount) at a time, writes them to the cache folder and retrieves them from the cache folder when necessary. I also have a UIImageView subclass to which I can pass a URL, through the image downloader class it will look if the image already exists on the device and show it if it does, or download and show it after it finished. After an image finishes downloading I do the following. I create a UIImage from the downloaded NSData, save the downloaded NSData to disk and return the UIImage. // This is

ITextSharp returning same size pdf when I'm trying to compress pdf file with different levels

谁都会走 提交于 2019-11-29 11:42:49
I'm reading a pdf and injecting some content using itextsharp. The resulting byte[] is passed to the method below along with the compression level. public static byte[] method(byte[] pdf,int compressionlevel) { using (MemoryStream outputPdfStream1 = new MemoryStream()) { //PdfReader reader1 = new PdfReader(pdf); //PdfStamper stamper1 = new PdfStamper(reader1, outputPdfStream1); //int level = (int)compressionlevel; //if (level <= 9) // stamper1.Writer.CompressionLevel = (int)compressionlevel; //else // stamper1.Writer.SetFullCompression(); //stamper1.SetFullCompression(); //stamper1.Close(); /