TIFF on place edition - c++

I need to rewrite some lines of uncompressed tiff file.
The probles is that I need to do it without copying entire file to another place.
Only way I found is to read the specifications and write my own code to work with tiff files.
libtiff doesn't allow to open file for read and write.
libgeotiff is libtiff based.
gdal also doesn't allow in place editing of files.

GDAL is the best library to do this.

Related

c++ - Archive files present in different directories and accessing single files

I have many text files that are located in different directories -
dir1/.../textfiles/<various .txt files>
dir2/.../textfiles/<various .txt files>
and so on...
I need a c++ solution to compress and archive all these files present in different directories. I also need a way to search, decompress and open only a particular file in this archive.
One solution I can think of is to use system calls to create a tar archive.
I actually want a purely C++ based solution to this problem that is simple and fast and gives the desired result.
I searched a lot about this on the internet and found a few solutions like using Chilkat or libtar libraries but I do not intend to use them.
Another one that I found out is this.
Is there any simple C++ solution to this problem?

Load bitmap file (.bmp)

I noticed the boost::gil::extension::io only supports png or jpeg files.. While this is often enough I'm wondering how to load a bitmap (*.bmp) file into an image? Shouldn't this be actually easier than jpeg etc?
Hopefully you solved it.
Just to add: install latest version of GIL on existing boost and then compile.
The bitmap files comes under new 'io_new' folder.

Free C/C++ based zip/zip64 library?

After having false starts with poco's zip and minizip (both have issues, minizip can't decompress files larger than 2gb and poco zip corrupts any zip file larger than 2 gigs it compresses) I was wondering if there was anything else left?
So any suggestions for a C++ archive library that can handle zip AND zip64?
7-zip handles both, as far as I could tell from a quick glance at their source code. It's also LGPL, which should allow its use in a closed source app.
Well there is the all-around very proven ZLIB : http://zlib.net/

What is the fastest way to access files in a zip file?

What is the fastest way to read individual files (in a random fashion) from a zip file?
As I understand it, zip files have a directory that stores the individual file entries, and I could scan this directory to build an external index. Are there any standardized ways (i.e. existing libraries) that already do that? Or could I use a specialized type of zip file?
Scanning the directory and building the index is the fastest and best way to provide random access to the compressed entries archived in a zip file. The directory is usually small and lies at the end of the archive. If you have seekable media, then this is what you want.
The zip format is documented pretty well; it's not too hard to do. The devil is in the details, though. If your zip files use ZIP64 extensions, encryption, split archives.. that's when it gets tricky. For simple zip files, doing what you imagine is not so difficult.
Still it would be easier to use an external library.
Minizip seems to be a good library for reading or writing zip files. It uses the zlib library.
http://www.winimage.com/zLibDll/minizip.html

What libraries should I use to manipulate archives from C++?

I want to manipulate .zip and .rar files from C++. What libraries should I use?
The zlib library comes with a sample showing how you can use it with .zip files (I think it's called "minizip" or something, though I haven't had much experience with it personally).
RAR is a bit difference, since it's basically proprietary. I don't know if there's any libraries that can do it.
zlib and minizip, yes. minizip was last updated in 2005. Some facts about version 1.01e:
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g, WinZip, InfoZip tools and compatible.
Multi volume ZipFile (span) are not supported.
Encryption compatible with pkzip 2.04g only supported
Old compressions used by old PKZip 1.x are not supported
boost::iostreams also is a good choice.
Open Source Ogre3d has implementation of zip decompressor, you can read it.
Codeka is correct in recommending zlib, but if you're on Windows, you might want to take a look at ZipUtils, which is zlib repackaged with a simpler interface and a few bells and whistles added.