I have a container file which consists of a header (plain text data) and a bunch of JPGs, divided by few tenth of zeroes.
I currently have some code in Python, which do the following:
0xFF
, 0xD8
) marker;0xFF
, 0xD9
) marker;feed
, from Pillow library, function to read image itself and save to write it to file;I want to rewrite it in C++, but stuck with reading JPG, I want complete analogue of feed
function: C++ library that can read JPG between start and stop from fstream
or FILE *
.
Is there something like this in boost::GIL
? Or any other suggestion.
I myself would use Qt library, specifically QImageReader/QImageWritter. They can read from (and write to) QFile, which can be used to search (and eventually manipulate) the file before image reading.
Qt gives massive support to construct GUI as well. So you could easily display e.g. image preview to the user, while allowing him to type in file or even path name or easily select them via file browser widget.
If you plan more high-level work in C++, Qt is my recommended first vote general purpose library. Plenty of opportunities once you make Qt linking (which can be little tricky in non-linux-distro environments, but is doable in day(s) anyways). Qt learning base looks huge at first, but the documentation is great and the curve can be pretty steep.