compression

uncompressing zipped data files before committing to repository

余生长醉 提交于 2020-01-02 03:54:46
问题 Does it make any sense to somehow store an "uncompressed" version of normally-compressed files in the repository? If so, is there a standard way to implement this? (Perhaps a standard pre-commit hook that uncompresses each such file into a specially-named folder; and a post-checkout hook that compresses such specially-named folders into the compressed files that LibreOffice knows how to read and write? Something like the process described by "Should I decompress zips before I archive?" ?)

What's the most that GZIP or DEFLATE can increase a file size?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 03:01:57
问题 It's well known that GZIP or DEFLATE (or any compression mechanism) can increase file size sometimes. Is there a maximum (either percentage or constant) that a file can be increased? What is it? If a file is X bytes, and I'm going to gzip it, and I need to budget for file space in advance - what's the worst case scenario? UPDATE: There are two overheads: GZIP adds a header, typically 18 bytes but essentially arbitrarily long. What about DEFLATE? That can expand content by a multiplicative

creating zip file from a folder - in c++

喜你入骨 提交于 2020-01-01 19:41:14
问题 I want to create a program that , when executed, will compress a selected folder. Can it be done? 回答1: If you don't want to use boost, there's also zlib, along with minizip, which is a wrapper around zlib for managing zip files. 回答2: In C++ probably the best option is to go to the Boost library. You can find it here. 来源: https://stackoverflow.com/questions/1198717/creating-zip-file-from-a-folder-in-c

creating zip file from a folder - in c++

假装没事ソ 提交于 2020-01-01 19:41:06
问题 I want to create a program that , when executed, will compress a selected folder. Can it be done? 回答1: If you don't want to use boost, there's also zlib, along with minizip, which is a wrapper around zlib for managing zip files. 回答2: In C++ probably the best option is to go to the Boost library. You can find it here. 来源: https://stackoverflow.com/questions/1198717/creating-zip-file-from-a-folder-in-c

AVAssetExportSession outputfile

六眼飞鱼酱① 提交于 2020-01-01 10:01:49
问题 How should the AVAssetExportSession output file look like? I'm trying to compress a video from an ALAsset item and it doesn't work. I'm guessing the output file has something to do with it. Here's the code i'm using: NSString *destinationPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie"]; [self convertVideoToLowQualityWithInputURL:asset.defaultRepresentation.url outputURL:[NSURL URLWithString:destinationPath]]; - (void)convertVideoToLowQualityWithInputURL:(NSURL*

How can I create multipart compressed zip file in java

只愿长相守 提交于 2020-01-01 09:19:31
问题 I need to compress a directory inside a zip (tar, gz, 7z, etc.) file. It's ok but I need to create multipart zip files connected to each other (like file1.part1.zip, file1.part2.zip) How can i create multipart zip file in java? Each part must have a maximum size limit. 回答1: Zip4j supports creation of split zip file. Here's a sample to create a split zip file (Sample taken from Zip4j examples package) ZipFile.createZipFile(File sourceFile, ZipParameters parameters, boolean splitArchive, long

Imagemagick animated gif size optimization

守給你的承諾、 提交于 2020-01-01 09:16:36
问题 I am use this code to resize and save a animated gif (php): system("convert *originalfile* -resize *size* -coalesce *newfile*); Once done the filesize is quite large. Usually larger than the original even! What can I do to reduce the file size? I used convert $completeMiff -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 $optimizedFile_16 and the file gets even bigger??? 回答1: Add -layers optimize system("convert *originalfile* -resize *size* -coalesce -layers optimize

Python equivalent of piping file output to gzip in Perl using a pipe

℡╲_俬逩灬. 提交于 2020-01-01 08:50:38
问题 I need to figure out how to write file output to a compressed file in Python, similar to the two-liner below: open ZIPPED, "| gzip -c > zipped.gz"; print ZIPPED "Hello world\n"; In Perl, this uses Unix gzip to compress whatever you print to the ZIPPED filehandle to the file "zipped.gz". I know how to use "import gzip" to do this in Python like this: import gzip zipped = gzip.open("zipped.gz", 'wb') zipped.write("Hello world\n") However, that is extremely slow. According to the profiler, using

c++ compress byte array

∥☆過路亽.° 提交于 2020-01-01 07:03:41
问题 Greetings all, I load set of images and generate volume data.I save this volume data in a unsigned char *volume array. Now I want to save this array in a file and retrieve.But before saving I want to compress the byte array since the volume data is huge. Any tips on this? Thanks in advance. 回答1: volume in your example is not an array. As for compression, there are books written on the topic. For something quick and easy to use with C++, check out the boost.iostream library, which comes with

I thought *.DDS files were meant to be quick to load?

≡放荡痞女 提交于 2020-01-01 05:47:26
问题 Ok, so I'm trying to weigh up the pro's and con's of using various different texture compression techniques. I spend 99.999% of my time coding 2D sprite games for Windows machines using DirectX. So far I have looked at texture packing (SpriteSheets) with alpha-trimming and that seems like a decent way to get a bit more performance. Now I am starting to look at the texture format that they are stored in; currently everything is stored as *.PNGs. I have heard that *.DDS files are good,