Basic reading and writing of heif files
Hi,
Trying to get some basic functionality going on for heif in --> heif out. target file gets created with small size and no image data the original heif is apple created ( grid image )
Is this type of implementation supposed to work ?
heif_context * hc = heif_context_alloc();
heif_context_read_from_file(hc,file_name.c_str(),0);
heif_context_write_to_file(hc,outfile_name.c_str());
heif_context_free(hc);
Thanks
No, libheif does not support modifying existing files yet. They can be read or created from scratch, but not modified.
I see. In that case I would be very helpful to know if libheif has evolved to allow the following :
- Is there anyway to get the encoded hevc data without using a dummy decoder ?
- Is there anyway to write a new heif file but supply pre-encoded hevc data ( no dummy encoder..) ?
Many thanks -Eli
But you only need to re-create the container file structure, not re-encoding the image data itself?
@phako yes, that is correct, the encoding will take place in a different library.
This is a patch with a proof of concept CLI tool dedicated to patch an HEIF file with 3 metadata chunks : Exif, Iptc, and Xmp. Chunk files are attached as zip archive and are extracted from a JPEG file using exiftool.
updatemetadata.patch.txt metadata-chunks.zip
The goal of this tool is to open an HEIF file and to replace all metadata chunk without to re-encode the image. This kind of concept can be improved to patch ICC color chunk too.
If this king of tool can work with a modified libheif, well Exiv2 shared library will use a similar code to write metadata in HEIF container.
Gilles Caulier
Ping ? Did you take a look to my patch and my comment from my previous post ?
Thanks in advance
Gilles Caulier
Please provide patches as pull-request so they are easier to review / comment on.
No need to create a PR for this patch, as it add only a new C++ CLI tool in compilation chain. That all...
The zip file contains .dat file for exif, iptc, and xmp chuncks taken from a JPEG image. the CLI tool load these byte-array to replace exif, iptc, and xmp in a target HEIF image.
The result give of course a broken target file as libheif is not able to play with metadata chunck without re-encoding.
Gilles Caulier
Any news on this?
Any news on this?