PHP - Simple script for image compression with pngquant

:) i found this 1 line of code in another post which successfully compresses the image using pngquant. the thing is, it outputs the optimised image with a different name (obviously to preserve the original). im trying to find a way to: a) add a minim

How to compress a large file in Python?

The problem I'm experiencing is the name of the stored file. The stored file isn't named with the original/uncompressed file name. Instead the stored file is named with the archive name (with the appended ".gz" extension). Expected Result: file.

RLE text compression in c

i want to write a code which converts for example this text: "aaaaaaabbbb" into :"a7b4". It should read from one file and write to another. Here is the wrong part of the code and i cannot make it work. Ty for help.. fread(&fx,sizeo

C # MemoryStream is larger than FileStream

I've a method to compress a byte-array. I used a memorystream and a filestream for testing. the result from the memorystream is larger, even if its the same method, can anyone explain why? public byte[] DeflateCompress(byte[] data2Compress) { using (

What is an effective way to store a time series?

I've a pretty large amount of data in a horrible format: 16.4GiB of zip files containing csv files. Each csv contains lines like TYPE,2014-07-02 04:04:23.806,0.94598,0.94607 Basically: A TYPE (there are 14 different types and they could ideally grow

How to decompress an XZ file faster in Java?

My SQLite db file of size 85MB is compressed using XZ format and its size has been reduced to 16MB. I use the following code (and a JAR provided by XZ for Java) to decompress it in Android Jelly Bean: try { FileInputStream fin = new FileInputStream(p

How to convert integers to base64 (0-9A-Za-z)

I have been trying to reduce the length of the way. I represent some integer ID's in my program. For Example 2 3 15 26 63 ... 151564852 I would like them to be represented as such (0-9A-Za-z only) 2 3 F Q z ... vDF25a //For example The approach I tho

Compress the data

For some reason I can't find a solid example online on how to do the following, so if anyone here can help that would great I am transferring files over a socket in Java 6 and I would like to compress the data. I have looked into the ZIP Input Stream

Read the batch file - Compressed file vs decompresses

I am looking for the fastest way to read a sequential file from disk. I read in some posts that if i compressed the file using for example, lz4, i could achieve better performance than read tje flat file, becausa i will minimize the i/o operations. B

How can I write files that gzip well?

I'm working on a web project, and I need to create a format to transmit files very efficiently (lots of data). The data is entirely numerical, and split into a few sections. Of course, this will be transferred with gzip compression. I can't seem to f

Template matching the tuple element queue list

I have some Run Length Encoding code that I wrote as an exercise let rle s = s |> List.map (fun x -> (x, 1)) |> List.fold (fun acc x -> match acc with | [] -> [(x, 1)] | h::(x, n) -> h::(x, n+1) | h -> h::(x, 1) ) |> List.map (fun

how to configure grunt.js to reduce files separately

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' } } Ha

Disable Compression in Windows Azure Preview

This might sound like a strange request, but I need to test something and need the ability to disable compression on a Windows Azure website. The site is running as a website in preview mode and this means I am not able to log into the VM to adjust t

How to effectively store game data in a URL query string?

Background I have written a simple WebGL puzzle game and I want to allow people to design and share their own levels. My idea was to store the level data in the query string of a URL. This would then let people simply share the URL if they wanted a f

How to read the individual bytes of a file

I am trying to determine whether or not a file has been compressed with the GZip protocol. The consensus seems to be that I need to read the first two bytes of the file, and check that they are equal to 0x1f8b. I have just learned that this is known

Lempel-Ziv 76 complexity

Can someone explain to me Lempel-Ziv 76 complexity? I was under the impression that you initialize with the first letter of the string in your dictionary, and then check subsequent blocks for existence in the previous substring, growing one letter ea

The best way to compress a string in PHP

This question already has an answer here: Which compression method to use in PHP? 3 answers I am compressing the array with gzcompress(json_encode($arr),9). So I am converting array into string with json_encode and then compress with gzcompress. But

django-pipeline does not compress

I have just installed django-pipeline into my django application and it doesn't seem to be compressing my javascript files. It seems to be installed properly as the template tags are working correctly. I'm using manage.py collectstatic in order to co

Are algorithms like Huffman coding really used in production?

Background (not pertinent to the question) Now, I'm sure this sounds like a pretty naïve question, but it probably won't sound that way if you understand where I'm coming from. I have had years of web design experience (about a decade) and I've been

PHP & amp; JS works to compress strings (form entries)

My project has an editor which users will save large text to MySQL. I'm using PHP & Javascript, jQuery. I have been looking, search, google, etc. but found no working example that has BOTH js & php code to compress(&encode) on client side &

Server side javascript minification

What is the best library/software to compress the dynamically generated javascript on server? I use javascriptzip to do so statically. Any solution for .Net platform? thank you. P.S. compression involves removing unnecessary spaces + language compres

Compress Java HashMap to send via RMI

We have a Client/Server application which communicates over RMI. The server sends HashMaps to the client. All works well, however when sending large HashMaps, transfer times can be slow. Is there any way to compress the HashMaps before sending, then

Extract a zip file

How can Extract a ZipFile in C#? (ZipFile is include file and Directory) As @Arnis L mentioned, will have problem unZipping .Zip files. Cannot use GZipStream to open a zip file, try DotNetZip or CGZipLibrary.dll

How to compress a WordprocessingML file into a readable docx

I have been trying to write a simple Markdown -> docx parser/writer, but am completely stuck with the last part, which should be the easiest: i.e. compressing the folder into a .docx that Word, or any other .docx reader, will recognize. My parser-wri

GZipping website (js, css, php)

I have been reading different articles on GZipping and am wondering what is the best way to gzip my files including: PHP JS CSS I saw this article: http://blog.mycila.com/2009/08/godaddy-gzip-compression.html Kind of blurry on the whole deal. Any sug

How do you unzip very large files in python?

Using python 2.4 and the built-in ZipFile library, I cannot read very large zip files (greater than 1 or 2 GB) because it wants to store the entire contents of the uncompressed file in memory. Is there another way to do this (either with a third-part