compression

Variable length integer encoding

孤街醉人 提交于 2019-12-01 03:58:52
问题 I am attempting to reverse engineer an LZ1/LZ77 decompression algorithm. The length of an area of the decode buffer/window to be output is encoded in the file as a variable length integer. I've read as much as I can about variable length integer encoding and the method being used in this case does not appear to be like any others I have seen. Perhaps to avoid patent issues or maybe just to obfuscate. The included code might not be quite complete but it is working on at least several files at

How to estimate GIF file size?

被刻印的时光 ゝ 提交于 2019-12-01 03:57:44
We're building an online video editing service. One of the features allows users to export a short segment from their video as an animated gif. Imgur has a file size limit of 2Mb per uploaded animated gif. Gif file size depends on number of frames, color depth and the image contents itself: a solid flat color result in a very lightweight gif, while some random colors tv-noise animation would be quite heavy. First I export each video frame as a PNG of the final GIF frame size (fixed, 384x216). Then, to maximize gif quality I undertake several gif render attempts with slightly different

How to Compress video file in android

↘锁芯ラ 提交于 2019-12-01 03:24:31
问题 I want to compress video file before uploading to server.I gone through this link How to compress a video to maximum level android, but i did not get an answer. Can anyone help me ?? 回答1: Give this a try mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); mediaRecorder.setVideoEncodingBitRate(690000 ); 回答2: We can compress video using ffmpeg in android. For integrating FFmpeg in android we can use precompiled libraries like ffmpeg-android. You can use below command

Reducing jar file size? [duplicate]

情到浓时终转凉″ 提交于 2019-12-01 03:13:12
This question already has an answer here: Minimizing jar dependency sizes 3 answers Is there a good app to reduce jar file size by eliminating redundant classes/methods/constant pool elements? (i.e. not reachable from a fixed set of entry points, assuming no reflection) I'm tired of pulling in bloated libraries when I'm just using a couple of methods from them. (I'm not talking about small "local" optimizations like making names smaller. I'm thinking more of something that does global analysis to figure out which classes/methods/variables are used, given a set of entry points (including

Why I should not compress images in HTTP headers?

╄→гoц情女王★ 提交于 2019-12-01 03:05:25
I read some articles about HTTP headers compression. Today I installed YSlow and it recommends that I compress the resources (text/html, javascript, css and images). Now I'm reading the documentation for Apache mod_deflate but in the example don't compress images. Should I or should I not compress images in my site? Your images should already be compressed - any extra compression won't have any noticeable effect on filesize, but will increase processing time. .png files use DEFLATE compression already. .jpg files generally use lossy compression . .gif files use LZW compression . Compressing

Compressing multiple files using zlib

纵然是瞬间 提交于 2019-12-01 02:26:45
The below code will compress one file. How can I compress multiple files var gzip = zlib.createGzip(); var fs = require('fs'); var inp = fs.createReadStream('input.txt'); var out = fs.createWriteStream('input.txt.gz'); inp.pipe(gzip).pipe(out); Something that you could use: var listOfFiles = ['firstFile.txt', 'secondFile.txt', 'thirdFile.txt']; function compressFile(filename, callback) { var compress = zlib.createGzip(), input = fs.createReadStream(filename), output = fs.createWriteStream(filename + '.gz'); input.pipe(compress).pipe(output); if (callback) { output.on('end', callback); } } #1

Method to determine if an exe file has been compressed with UPX

断了今生、忘了曾经 提交于 2019-12-01 02:17:55
问题 Is there a method to determine if an exe file has been compressed with UPX? The function to determine if an exe file has been compressed is excellent except I found a problem with the code. If the function IsUPXCompressed is called then you try to run upx, upx can not save the file it modifies. There is something not sharing rights correctly in the function. I have tested this for several hours. If I do not call the method then UPX can write the files with no problem. You you call it then try

Elasticsearch remove default fields from search's response body

蓝咒 提交于 2019-12-01 00:15:28
Im doing a query that returns like 70k documents (I need all of them, and Im currently using scan & scroll) What happens is that the response is very large (2 MB and we alredy reduced it from 6 MB). We alredy filtered the fields we needed, and since the query is only called from an API we reduced the name of the properties. What i can see is that every document in the array "hits" has the following default fields that i really dont need them: _index (we only request on one index) _type (we only request on one type) _id (we alredy have this on a field) _score (we are not scoring) Is there a way

Node.js proxy, dealing with gzip DEcompression

﹥>﹥吖頭↗ 提交于 2019-12-01 00:03:35
I'm currently working on a proxy server where we in this case have to modify the data (by using regexp) that we push through it. In most cases it works fine except for websites that use gzip as content-encoding (I think), I've come across a module called compress and tried to push the chunks that I receive through a decompress / gunzip stream but it isn't really turning out as I expected. (see below for code) figured i'd post some code to support my prob, this is the proxy that gets loaded with mvc (express): module.exports = { index: function(request, response){ var iframe_url = "www.nu.nl";

Java - Read BZ2 file and uncompress/parse on the fly

社会主义新天地 提交于 2019-11-30 23:31:13
问题 I have a fairly large BZ2 file that with several text files in it. Is it possible for me to use Java to uncompress certain files inside the BZ2 file and uncompress/parse the data on the fly? Let's say that a 300mb BZ2 file contains 1 GB of text. Ideally, I'd like my java program to say read 1 mb of the BZ2 file, uncompress it on the fly, act on it and keep reading the BZ2 file for more data. Is that possible? Thanks 回答1: The commons-compress library from apache is pretty good. Here's their