issue_owner_repo
listlengths 2
2
| issue_body
stringlengths 0
261k
⌀ | issue_title
stringlengths 1
925
| issue_comments_url
stringlengths 56
81
| issue_comments_count
int64 0
2.5k
| issue_created_at
stringlengths 20
20
| issue_updated_at
stringlengths 20
20
| issue_html_url
stringlengths 37
62
| issue_github_id
int64 387k
2.46B
| issue_number
int64 1
127k
|
---|---|---|---|---|---|---|---|---|---|
[
"strukturag",
"libheif"
]
| Hello,
I found one old file which produce crash: http://188.121.162.14/libheif/a.heic
```
==746== Memcheck, a memory error detector
==746== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==746== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==746== Command: heif-convert a.heic x.png
==746==
File contains 1 images
==746== Invalid write of size 8
==746== at 0x483E2C9: memmove (vg_replace_strmem.c:1270)
==746== by 0x48F8231: heif::HeifContext::decode_and_paste_tile_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const (heif_context.cc:1572)
==746== by 0x48F79D9: heif::HeifContext::decode_full_grid_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, std::vector<unsigned char, std::allocator<unsigned char> > const&) const (heif_context.cc:1460)
==746== by 0x48F5CD3: heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (heif_context.cc:1152)
==746== by 0x48F6887: heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (heif_context.cc:1264)
==746== by 0x48F7DBB: heif::HeifContext::decode_and_paste_tile_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const (heif_context.cc:1525)
==746== by 0x48F79D9: heif::HeifContext::decode_full_grid_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, std::vector<unsigned char, std::allocator<unsigned char> > const&) const (heif_context.cc:1460)
==746== by 0x48F5CD3: heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (heif_context.cc:1152)
==746== by 0x48F4FB3: heif::HeifContext::decode_image_user(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const (heif_context.cc:1003)
==746== by 0x48E3A1B: heif_decode_image (heif.cc:907)
==746== by 0x10BECE: main (in /usr/bin/heif-convert)
``` | Invalid write of size 8 | https://api.github.com/repos/strukturag/libheif/issues/453/comments | 2 | 2021-02-27T15:55:09Z | 2021-02-27T19:46:19Z | https://github.com/strukturag/libheif/issues/453 | 817,957,055 | 453 |
[
"strukturag",
"libheif"
]
| A small optimisation :-).
Functions `Box_ipco::get_properties_for_item_ID` & `Box_ipco::get_property_for_item_ID` make unnecessary copies of `m_children` vector.
File box.cc, line 1947:
```
auto allProperties = get_all_child_boxes();
```
Should be:
```
auto& allProperties = get_all_child_boxes();
```
The above occurs again at line 1981.
| Unnecessary copying of child-boxes vector | https://api.github.com/repos/strukturag/libheif/issues/450/comments | 1 | 2021-02-25T22:29:28Z | 2021-02-27T20:14:37Z | https://github.com/strukturag/libheif/issues/450 | 816,861,080 | 450 |
[
"strukturag",
"libheif"
]
| I experienced a 100% reproducible crash in `Op_RGB_HDR_to_RRGGBBaa_BE::convert_colorspace` when
`input->has_channel(heif_channel_Alpha)` returns true but `target_state.has_alpha` is false.
File: heif_colorconversion.cc, line: 1069
```
Op_RGB_HDR_to_RRGGBBaa_BE::convert_colorspace(const std::shared_ptr<const HeifPixelImage>& input, …
…
bool has_alpha = input->has_channel(heif_channel_Alpha); // ← has_alpha is true
outimg->create(width, height, heif_colorspace_RGB,
target_state.has_alpha ? heif_chroma_interleaved_RRGGBBAA_BE : heif_chroma_interleaved_RRGGBB_BE);
```
This results in `outimg` being created with chroma = interleaved_RRGGBB_BE i.e. no alpha, but then having alpha values written to it as that is decided by `has_alpha` and `target_state.has_alpha` is ignored.
I stopped the crash by changing it to:
```
outimg->create(width, height, heif_colorspace_RGB,
/*target_state.*/has_alpha ? heif_chroma_interleaved_RRGGBBAA_BE : heif_chroma_interleaved_RRGGBB_BE);
```
I don’t know if that is fully correct or whether the output generation needs an alternate case for `if (!has_alpha && target_state.has_alpha) …` instead.
Similarly, `Op_RGB_to_RRGGBBaa_BE::convert_colorspace` appears to contain the same logic, so probably requires a similar fix.
However, `Op_RGB_to_RRGGBBaa_BE::convert_colorspace` also appears to be using the wrong bytes-per-pixel when `!has_alpha`. I think it should be 6 (rather than 8).
lines: 1286 .. 1291
```
out_p[y * out_p_stride + 8 * x + 0] = 0;
out_p[y * out_p_stride + 8 * x + 1] = in_r[x + y * in_r_stride];
out_p[y * out_p_stride + 8 * x + 2] = 0;
out_p[y * out_p_stride + 8 * x + 3] = in_g[x + y * in_g_stride];
out_p[y * out_p_stride + 8 * x + 4] = 0;
out_p[y * out_p_stride + 8 * x + 5] = in_b[x + y * in_b_stride];
```
Should be:
```
out_p[y * out_p_stride + 6 * x + 0] = 0;
out_p[y * out_p_stride + 6 * x + 1] = in_r[x + y * in_r_stride];
out_p[y * out_p_stride + 6 * x + 2] = 0;
out_p[y * out_p_stride + 6 * x + 3] = in_g[x + y * in_g_stride];
out_p[y * out_p_stride + 6 * x + 4] = 0;
out_p[y * out_p_stride + 6 * x + 5] = in_b[x + y * in_b_stride];
```
Or even better :-):
```
auto dst = &out_p[y * out_p_stride];
for (int x = 0; x < width; ++x, dst += 6) {
dst[0] = 0;
dst[1] = in_r[x];
dst[2] = 0;
dst[3] = in_g[x];
dst[4] = 0;
dst[5] = in_b[x];
}
in_r += in_r_stride;
in_g += in_g_stride;
in_b += in_b_stride;
```
| Crash in Op_RGB_HDR_to_RRGGBBaa_BE::convert_colorspace | https://api.github.com/repos/strukturag/libheif/issues/449/comments | 3 | 2021-02-25T22:17:42Z | 2021-04-28T21:52:21Z | https://github.com/strukturag/libheif/issues/449 | 816,854,033 | 449 |
[
"strukturag",
"libheif"
]
| This worked in the past, but right now, using libheif to encode gray data into avif, or the example heif_enc program to convert a grayscale png to avif results in the data being encoded as RGBA.
Opening grayscale avifs works fine, and saving and loading a heif file also works fine.
I build master just half an hour ago to make sure I wasn't missing fixes, but the problem remains.
EDIT: My colleague pointed out rav1e doesn't support monochrome, but I am using libaom. I think for rave1, 'converting' to YCbCr is acceptable, but if libheif cannot by itself tell you that only the Y channel is used, it should be documented that this might be the caste. | Saving to monochrome AVIF does not seem to work. | https://api.github.com/repos/strukturag/libheif/issues/447/comments | 5 | 2021-02-25T16:10:20Z | 2021-03-23T13:27:25Z | https://github.com/strukturag/libheif/issues/447 | 816,579,313 | 447 |
[
"strukturag",
"libheif"
]
| I can not figure out how to include libde265 in my cmake project. I am using git submodules to include both libde265 and libheif. I get `unsupported codec` whenever I try to decode a heic file. I looked an confirmed this is because libheif doesnt recognize the libde265 library. I am using windows.
this is the relevant parts of cmakelists.txt
```
# libde265
add_subdirectory(external/libde265)
include_directories(
${CMAKE_SOURCE_DIR}/external/libde265/libde265
${CMAKE_SOURCE_DIR}/build/external/libde265/libde265
${CMAKE_SOURCE_DIR}/build/external/libde265
${CMAKE_SOURCE_DIR}/external/libde265
)
target_link_libraries(my_project libde265)
# libheif
add_subdirectory(external/libheif)
include_directories(
${CMAKE_SOURCE_DIR}/external/libheif
${CMAKE_SOURCE_DIR}/build/external/libheif
)
target_link_libraries(my_project heif)
```
I see [here](https://github.com/strukturag/libheif/issues/436#issuecomment-772750763) @silverbacknet said if youre on windows you need to set an environment variable, the question is what environment variable. I have tried
```
set(LIBDE265_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external/libde265/libde265)
set(LIBDE265_LIBRARY external/libde265)
```
It is found when compiling, but I still get the `unsupported codec` error
I have also tried adding add_definitions(-DLIBDE265_STATIC_BUILD) in libheif "CMakeLists.txt" [like this issue](https://github.com/strukturag/libheif/issues/413#issuecomment-753485750) suggests.
I still get `HEIF decoder, libde265: not found` when running `cmake ..`
How can I make sure the find_package call in libheif
s cmakelists.txt file can find the installed libde265? What environment variable do I need to set? is that the only thing I need to do?
Any help appreciated. Thank you. | including libde265 help | https://api.github.com/repos/strukturag/libheif/issues/446/comments | 2 | 2021-02-24T04:48:31Z | 2022-02-17T22:14:09Z | https://github.com/strukturag/libheif/issues/446 | 815,087,459 | 446 |
[
"strukturag",
"libheif"
]
| The following code looks wrong.
In function Op_RGB_to_YCbCr<Pixel>::convert_colorspace in heif_colorconversion.cc, line 728:
```
if (!full_range_flag) {
cb = (cb * 224) / 256;
cr = (cb * 224) / 256; // ← ????
}
```
I think it should probably be:
```
if (!full_range_flag) {
cb = (cb * 224) / 256;
cr = (cr * 224) / 256; // ← change here
}
```
Additionally, I was wondering about all the `… / 256` occurrences in this function - as it is templated to support 8-bit or 16-bit pixels. Is this correct for 16-bit?
| Possible error in Op_RGB_to_YCbCr<Pixel>::convert_colorspace | https://api.github.com/repos/strukturag/libheif/issues/445/comments | 3 | 2021-02-23T06:09:46Z | 2021-02-23T07:41:37Z | https://github.com/strukturag/libheif/issues/445 | 814,146,395 | 445 |
[
"strukturag",
"libheif"
]
| Would it be possible to add support for `heif_image_handle_get_chroma` (or maybe call it `heif_image_handle_get_image_chroma`?) so we can use the return value of that method when calling `heif_decode_image`? We are now always using `heif_chroma_420` in the @ImageMagick project but if the image was encoded with `heif_chroma_444` there will be a bit of quality loss.
```c
enum heif_chroma heif_image_handle_get_chroma(const struct heif_image_handle* handle)
{
return handle->image->get_chroma();
}
```
```c
enum heif_chroma HeifContext::Image::get_chroma() const
{
heif_item_id id;
Error err = m_heif_context->get_id_of_non_virtual_child_image(m_id, id);
if (err) {
return heif_chroma_undefined;
}
return m_heif_context->m_heif_file->get_image_chroma_from_configuration(id);
}
``` | Add support for heif_image_handle_get_chroma | https://api.github.com/repos/strukturag/libheif/issues/442/comments | 2 | 2021-02-21T10:37:26Z | 2021-02-22T21:27:22Z | https://github.com/strukturag/libheif/issues/442 | 812,823,932 | 442 |
[
"strukturag",
"libheif"
]
| Platform macOS big sur
```
% uname -A
Darwin tome.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
```
Simple crash trying to get parameter help.
```
% heif-enc -A -P
Parameters for encoder `AOMedia Project AV1 Encoder 2.0.2`:
realtime, default=false
speed, default=5, [0;8]
threads, default=4, [1;16]
quality, default=50, [0;100]
lossless, default=false
chroma, default=420, { 420,422,444 }
tune, default=ssim, { psnr,ssim,Segmentation fault
```
```
% brew info libheif
libheif: stable 1.11.0 (bottled)
ISO/IEC 23008-12:2017 HEIF file format decoder and encoder
https://www.libde265.org/
/usr/local/Cellar/libheif/1.11.0 (25 files, 2.8MB) *
Poured from bottle on 2021-02-11 at 19:45:06
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libheif.rb
License: LGPL-3.0-only
==> Dependencies
Build: pkg-config ✔
Required: aom ✔, jpeg ✔, libde265 ✔, libpng ✔, shared-mime-info ✔, x265 ✔
``` | heif-enc -A -P segfault | https://api.github.com/repos/strukturag/libheif/issues/441/comments | 4 | 2021-02-20T18:23:00Z | 2023-05-31T09:52:38Z | https://github.com/strukturag/libheif/issues/441 | 812,678,054 | 441 |
[
"strukturag",
"libheif"
]
| Samsung HEIC files can contain a preview image that is 236x512 (with irot; without irot, it's 512x236).
However, heif_image_handle_get_width(handle) and heif_image_handle_get_height(handle) both return 512 for the preview image. I think the problem is that it's finding the first ispe and not the one assigned to the preview image.
Sample image: https://fotoforensics.com/analysis.php?id=c90757b796e4f63611f597e4999fffe840bfec42.934930&fmt=orig
There are 3 ispe records: grid (512x512), big image based on grid (1860x4032 rotated), and preview (236x512 rotated).
| | | Box: ispe -----
| | | size: 20 (header size: 12)
| | | version: 0
| | | flags: 0
| | | image width: 512
| | | image height: 512
| | |
| | | Box: ispe -----
| | | size: 20 (header size: 12)
| | | version: 0
| | | flags: 0
| | | image width: 4032
| | | image height: 1860
| | |
| | | Box: irot -----
| | | size: 9 (header size: 8)
| | | rotation: 90 degrees (CCW)
...
| | | Box: ispe -----
| | | size: 20 (header size: 12)
| | | version: 0
| | | flags: 0
| | | image width: 512
| | | image height: 236
| | |
| | | Box: irot -----
| | | size: 9 (header size: 8)
| | | rotation: 90 degrees (CCW)
| Preview image has wrong dimensions | https://api.github.com/repos/strukturag/libheif/issues/439/comments | 1 | 2021-02-18T06:30:08Z | 2021-02-22T12:10:11Z | https://github.com/strukturag/libheif/issues/439 | 810,804,061 | 439 |
[
"strukturag",
"libheif"
]
| Hello,
I converted a transparent PNG (dimensions 2048x**1315**) to .avif and to .heif file:
`heif-enc -q 100 -o encoded8.heif 08.png`
`heif-enc -q 100 -A -o encoded8.avif 08.png`
The .avif file has alpha channel but the .heif doesn't.
```
heif-info encoded8.avif
MIME type: image/avif
main brand: avif
compatible brands: avif, mif1
image: 2048x1315 (id=1), primary
color profile: prof
alpha channel: yes
depth channel: no
```
```
heif-info encoded8.heif
MIME type: image/heic
main brand: heic
compatible brands: mif1, heic
image: 2048x1316 (id=4), primary
color profile: prof
alpha channel: no
depth channel: no
```
| Alpha channel not saved in HEIC files with odd dimensions. | https://api.github.com/repos/strukturag/libheif/issues/438/comments | 2 | 2021-02-08T16:03:02Z | 2021-02-26T09:18:08Z | https://github.com/strukturag/libheif/issues/438 | 803,698,009 | 438 |
[
"strukturag",
"libheif"
]
| Excute heif-enc project
error = heif_context_encode_image(context.get(),
image.get(),
encoder,
options,
&handle);
when measuring the speed, it came out about 9-10 seconds.
I want convert time is 200msec.
if i bitmap->heic or rawdata->heic, is it possible?
am i missing something? or have a good idea? | Speed up heif encoding | https://api.github.com/repos/strukturag/libheif/issues/437/comments | 2 | 2021-02-05T04:24:05Z | 2021-04-28T22:05:35Z | https://github.com/strukturag/libheif/issues/437 | 801,831,013 | 437 |
[
"strukturag",
"libheif"
]
| OS is windows10.
vcpkg install libheif, then git clone libheif.
excute autogen.sh and build-emscripten.sh

i have libde265-1.0.2 !
cmake Cmakelist.txt in libheif folder but

i don't know...
change folder name libde265-1.0.2 -> libde265 but same result...
CMakeCache.txt result

how can i do?
please help me | cmake CMakelist.txt -> libde265: not found, x265: not found | https://api.github.com/repos/strukturag/libheif/issues/436/comments | 5 | 2021-02-03T08:29:34Z | 2021-02-23T21:33:10Z | https://github.com/strukturag/libheif/issues/436 | 800,098,254 | 436 |
[
"strukturag",
"libheif"
]
| `HeifContext::~HeifContext` calls `Image::get_thumbnails` & `Image::get_aux_images` (both of which return **copies** of the vectors) it then clears the copies. Probably not what you wanted :-).
This patch adds a function `Image::clear` & calls it from `HeifContext::~HeifContext` to fix the problem.
```
--- heif_context.orig.h 2020-12-15 13:54:48.000000000 +0000
+++ heif_context.h 2021-01-28 20:34:52.000000000 +0000
@@ -129,6 +129,14 @@
m_height = h;
}
+ void clear ()
+ {
+ m_thumbnails.clear();
+ m_alpha_channel.reset();
+ m_depth_channel.reset();
+ m_aux_images.clear();
+ }
+
// -- thumbnails
--- heif_context.orig.cc 2020-12-15 15:24:08.000000000 +0000
+++ heif_context.cc 2021-01-28 20:32:12.000000000 +0000
@@ -398,13 +398,8 @@
HeifContext::~HeifContext()
{
// Break circular references
- for (auto& it : m_all_images) {
- std::shared_ptr<Image> image = it.second;
- image->get_thumbnails().clear();
- image->set_alpha_channel(nullptr);
- image->set_depth_channel(nullptr);
- image->get_aux_images().clear();
- }
+ for (auto& it : m_all_images)
+ it.second->clear();
}
Error HeifContext::read(std::shared_ptr<StreamReader> reader)
``` | HeifContext::~HeifContext doesn’t do what it is supposed to do | https://api.github.com/repos/strukturag/libheif/issues/434/comments | 1 | 2021-01-28T20:51:32Z | 2021-02-01T12:12:26Z | https://github.com/strukturag/libheif/issues/434 | 796,359,668 | 434 |
[
"strukturag",
"libheif"
]
| I appologise for submitting a patch in this manner. But, I’m an anti-git-er.
The function `HeifContext::get_metadata` does unnecessary copying of data.
This patch reduces the copying.
```
--- heif/libheif/heif_context.orig.h 2020-12-15 13:54:48.000000000 +0000
+++ heif/libheif/heif_context.h 2021-01-15 08:02:29.000000000 +0000
@@ -241,7 +241,7 @@
m_metadata.push_back(std::move(metadata));
}
- std::vector<std::shared_ptr<ImageMetadata>> get_metadata() const { return m_metadata; }
+ auto& get_metadata() const { return m_metadata; }
// === writing ===
--- heif/libheif/heif.orig.cc 2020-12-15 13:54:48.000000000 +0000
+++ heif/libheif/heif.cc 2021-01-15 08:04:39.000000000 +0000
@@ -1010,10 +1010,8 @@
int heif_image_handle_get_number_of_metadata_blocks(const struct heif_image_handle* handle,
const char* type_filter)
{
- auto metadata_list = handle->image->get_metadata();
-
int cnt = 0;
- for (const auto& metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (type_filter == nullptr ||
metadata->item_type == type_filter) {
cnt++;
@@ -1028,10 +1026,8 @@
const char* type_filter,
heif_item_id* ids, int count)
{
- auto metadata_list = handle->image->get_metadata();
-
int cnt = 0;
- for (const auto& metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (type_filter == nullptr ||
metadata->item_type == type_filter) {
if (cnt < count) {
@@ -1051,9 +1047,7 @@
const char* heif_image_handle_get_metadata_type(const struct heif_image_handle* handle,
heif_item_id metadata_id)
{
- auto metadata_list = handle->image->get_metadata();
-
- for (auto metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (metadata->item_id == metadata_id) {
return metadata->item_type.c_str();
}
@@ -1066,9 +1060,7 @@
const char* heif_image_handle_get_metadata_content_type(const struct heif_image_handle* handle,
heif_item_id metadata_id)
{
- auto metadata_list = handle->image->get_metadata();
-
- for (auto metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (metadata->item_id == metadata_id) {
return metadata->content_type.c_str();
}
@@ -1081,9 +1073,7 @@
size_t heif_image_handle_get_metadata_size(const struct heif_image_handle* handle,
heif_item_id metadata_id)
{
- auto metadata_list = handle->image->get_metadata();
-
- for (auto metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (metadata->item_id == metadata_id) {
return metadata->m_data.size();
}
@@ -1103,9 +1093,7 @@
return err.error_struct(handle->image.get());
}
- auto metadata_list = handle->image->get_metadata();
-
- for (auto metadata : metadata_list) {
+ for (auto& metadata : handle->image->get_metadata()) {
if (metadata->item_id == metadata_id) {
memcpy(out_data,
metadata->m_data.data(),
``` | Optimise HeifContext::get_metadata | https://api.github.com/repos/strukturag/libheif/issues/433/comments | 1 | 2021-01-28T20:41:30Z | 2021-02-01T12:27:06Z | https://github.com/strukturag/libheif/issues/433 | 796,350,788 | 433 |
[
"strukturag",
"libheif"
]
| This is based on the v1.10.0 sources.
In the function `ImageGrid::write` in file heif_context.cc, line 225 you have:
```
uint8_t flags = 0;
if (field_size == 32) {
flags |= 1;
}
```
But you don’t use `flags` anywhere else.
Should there not be a line following the above such as:
```
data[1] = flags;
```
Otherwise `data[1]` appears not to be set.
Or simply replace the whole thing with:
```
data[1] = (field_size == 32) ? 1 : 0;
```
| Possible Error in ImageGrid::write in heif_context.cc | https://api.github.com/repos/strukturag/libheif/issues/432/comments | 1 | 2021-01-28T18:15:43Z | 2021-01-28T18:36:05Z | https://github.com/strukturag/libheif/issues/432 | 796,239,143 | 432 |
[
"strukturag",
"libheif"
]
| Hi,
I am looking to compile the libheif as an external dependency in a cpp project using just cmake. I know vcpkg has it, but Im working on a team w people who dont have vcpkg, also I need it to build for OSX.
So far I have tried exporting pre-compiled binaries from vcpkg, I ran into many problems, also I dont think it will build for mac this way.
I am now trying to use find_package and then target_link_libraries, first I add libheif sourcecode to my project:
`git submodule add [https://github.com/strukturag/libheif.git](https://github.com/strukturag/libheif.git) external/libheif`
I see a lot of other projects that use libheif as a dependency will have a Findlibheif.cmake file. So that is what I am trying. I use this [findlibheif.cmake](https://raw.githubusercontent.com/zzag/heifthumbnailer/5f3e8380728751cafd8f0da78eae1b7da2b0d9ff/cmake/Modules/Findlibheif.cmake) file
So, inside of CMakeLists.txt for my_project I have:
```
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules/)`
find_package(libheif)
target_link_libraries(hop_studio_api libheif::libheif)
target_link_libraries(hop_studio_cli libheif::libheif)
```
but I got stuck at these errors
`-- Could NOT find libheif (missing: libheif_LIBRARY libheif_INCLUDE_DIR)
`
and then later on
```
Target "my_project" links to target "libheif::libheif" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
```
So when building with the source do I need to compile the library first by using add_library and then use find_package so it can find the .lib files? What search terms should I use to look up this problem? I have tried “writing a find module to build from source” among others, but I cant find useful information.
Thank you for your time.
| compiling as a dependency with cmake help for newbie | https://api.github.com/repos/strukturag/libheif/issues/430/comments | 3 | 2021-01-28T03:14:14Z | 2021-02-05T20:25:28Z | https://github.com/strukturag/libheif/issues/430 | 795,628,261 | 430 |
[
"strukturag",
"libheif"
]
| This line https://github.com/strukturag/libheif/blob/master/CMakeLists.txt#L67 fails to find ```rav1e```.
```rav1e-0.4.0``` is installed. https://github.com/xiph/rav1e
What is wrong?
FreeBSD 12.2 | Fails to find rav1e | https://api.github.com/repos/strukturag/libheif/issues/429/comments | 6 | 2021-01-27T23:52:47Z | 2021-02-01T12:34:33Z | https://github.com/strukturag/libheif/issues/429 | 795,545,079 | 429 |
[
"strukturag",
"libheif"
]
| I'm trying to add HEIC support to Imagemagick using the steps shown [here](https://askubuntu.com/a/1142317) and in other places.
After autogen and configuring, make fails with the following libtool error:
```
libtool: link: ar cr .libs/libpixbufloader-heif.a libpixbufloader_heif_la-pixbufloader-heif.o
libtool: link: ranlib .libs/libpixbufloader-heif.a
/usr/bin/sed: can't read Gallery/libheif/libheif/libheif.la: No such file or directory
libtool: error: 'Gallery/libheif/libheif/libheif.la' is not a valid libtool archive
make[2]: *** [Makefile:471: libpixbufloader-heif.la] Error 1
```
I can't see a Gallery directory and `find . libpixbufloader-heif*` yields no results.
I've Googled this error, but can't find any similar issues. Any clues?
Thanks in advance
| Libheif fails to build on Ubuntu 20.04.1 | https://api.github.com/repos/strukturag/libheif/issues/428/comments | 2 | 2021-01-25T19:23:48Z | 2021-03-26T10:30:46Z | https://github.com/strukturag/libheif/issues/428 | 793,659,998 | 428 |
[
"strukturag",
"libheif"
]
| The @ImageMagick library is using this library and we would like to know what would be the best way to detect if the image is either `HEIC` or `AVIF`. We have two different files with the following header:
```
// FILE1
00000000: 0000 0018 6674 7970 6176 6966 0000 0000 ....ftypavif....
00000010: 6176 6966 6d69 6631 0000 01fe 6d65 7461 avifmif1....meta
```
```
// FILE2
00000000: 0000 001c 6674 7970 6d69 6631 0000 0000 ....ftypmif1....
00000010: 6d69 6631 6176 6966 6d69 6166 0000 00f2 mif1avifmiaf....
```
`FILE1` has `avif` as the `heif_main_brand` but the second image has `mif1` instead. But both files contain `avif` in the compatible brands after the `heif_main_brand`. Would it be okay to also classify `FILE2` as `AVIF` because it contains `avif` in the compatible brands?
If that could be used to detect the "format" would it be possible to add something to the C API that we can use to check if the file contains a certain compatible brand?
```
int heif_has_compatible_brand(const uint8_t* data, int len, enum heif_brand brand);
``` | Detect if image is HEIC or AVIF | https://api.github.com/repos/strukturag/libheif/issues/427/comments | 8 | 2021-01-22T09:34:05Z | 2021-02-02T08:40:14Z | https://github.com/strukturag/libheif/issues/427 | 791,848,427 | 427 |
[
"strukturag",
"libheif"
]
| The out of the box build seems to break trying to link `libpixbufloader-heif.so`:
```
git clone https://github.com/strukturag/libheif.git && cd libheif
mkdir build
cmake ..
make
```
...
```
Scanning dependencies of target pixbufloader-heif
[ 97%] Building C object gdk-pixbuf/CMakeFiles/pixbufloader-heif.dir/pixbufloader-heif.c.o
[100%] Linking C shared module libpixbufloader-heif.so
ld: library not found for -lgdk_pixbuf-2.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [gdk-pixbuf/libpixbufloader-heif.so] Error 1
make[1]: *** [gdk-pixbuf/CMakeFiles/pixbufloader-heif.dir/all] Error 2
```
I'm using MacPorts and use its version of CMake (3.19.3) and gdk-pixbuf2 (2.42.2_2).
```
$ which cmake
/opt/local/bin/cmake
$ ls -1 /opt/local/lib/libgdk*
/opt/local/lib/libgdk-3.0.dylib
/opt/local/lib/libgdk-3.a
/opt/local/lib/libgdk-3.dylib
/opt/local/lib/libgdk_pixbuf-2.0.0.dylib
/opt/local/lib/libgdk_pixbuf-2.0.dylib
```
I'm not super familiar with CMake and pkg-config but it seems that the generated link.txt file isn't being passed `-L/opt/local/lib`. Instead, it contains:
```
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -bundle -Wl,-headerpad_max_install_names -o libpixbufloader-heif.so CMakeFiles/pixbufloader-heif.dir/pixbufloader-heif.c.o -Wl,-rpath,/Users/jiawen/Downloads/libheif-1.10.0/build/libheif -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl ../libheif/libheif.1.10.0.0.dylib
```
If I add `-L/opt/local/lib` to the end of `link.txt`, it compiles fine. | cmake build broken out of the box on MacOS | https://api.github.com/repos/strukturag/libheif/issues/426/comments | 2 | 2021-01-20T19:04:11Z | 2023-12-24T08:52:30Z | https://github.com/strukturag/libheif/issues/426 | 790,237,585 | 426 |
[
"strukturag",
"libheif"
]
| After compiling on Ubuntu 20.04 I get this error when trying to start `heif-enc`:
heif-enc: symbol lookup error: heif-enc: undefined symbol: heif_image_get_primary_width
libde265 is also installed by default: 1.0.4-1build1
How can I fix this? | heif-enc: symbol lookup error: heif-enc: undefined symbol: heif_image_get_primary_width | https://api.github.com/repos/strukturag/libheif/issues/425/comments | 4 | 2021-01-20T15:56:07Z | 2023-12-24T22:35:42Z | https://github.com/strukturag/libheif/issues/425 | 790,105,209 | 425 |
[
"strukturag",
"libheif"
]
| Hi everyone,
I am using libheif extensively to do some conversion between heif and png in python. Those images are coming from mobile devices iOS and Android and for the most part it works fine.
However, I have noticed an issue when converting or even displaying heif images coming from LG phones. I am not able to tell why specifically LG phones, but most probably their implementation of HEIF or even their saved image is different than the rest.
I don't have a lot of information regarding the internals of the library but I have reproducible examples.
The attached image opens fine on mac OSX preview and other viewers, but is completely broken when using libheif
The web demo shows this issues perfectly fine as well as the CLI.

I had to upload a zip file for the original HEIF image, as heif is not supported by github (how uncanny! - maybe they should use libheif :) )
[colorPano_0_2.heif.zip](https://github.com/strukturag/libheif/files/5842987/colorPano_0_2.heif.zip)
Please let me know if you need any information.
Thank you. | Squared artefacts on heif image when using libheif | https://api.github.com/repos/strukturag/libheif/issues/424/comments | 8 | 2021-01-20T14:19:56Z | 2021-02-01T12:02:44Z | https://github.com/strukturag/libheif/issues/424 | 790,019,238 | 424 |
[
"strukturag",
"libheif"
]
| As the title says, the function `heif_image_handle_get_depth_image_representation_info()`, whose comments don't mention the parameters, has `heif_item_id depth_image_id` as its second parameter. At first glance to a newcomer such as myself, it would seem to imply that `handle` refers to the main image handle, and this function would retrieve the metadata associated with one of its attached depth images (identified by `depth_image_id`).
To my surprise, this was not the case. Instead, `depth_image_id` is unused and `handle` is a depth image handle (one of the `heif_image_handle*`s returned by `heif_image_handle_get_depth_image_handle`).
Can we remove the parameter and add some comments? The main objection I see is that this breaks the API. | heif_image_handle_get_depth_image_representation_info has a confusing and unused depth_image_id parameter | https://api.github.com/repos/strukturag/libheif/issues/422/comments | 1 | 2021-01-15T21:18:21Z | 2021-02-01T14:13:10Z | https://github.com/strukturag/libheif/issues/422 | 787,197,928 | 422 |
[
"strukturag",
"libheif"
]
| Compiling with gcc-4.9.3 (mingw-w64) fails with:
```
./../libheif-1.10.0/libheif/heif_colorconversion.cc: In member function 'virtual std::shared_ptr<heif::HeifPixelImage> Op_RGB24_32_to_YCbCr::convert_colorspace(const std::shared_ptr<const heif::HeifPixelImage>&, heif::ColorState, heif::ColorConversionOptions)':
../../libheif-1.10.0/libheif/heif_colorconversion.cc:2037:35: error: 'out_a' may be used uninitialized in this function [-Werror=maybe-uninitialized]
out_a[y * out_a_stride + x] = a;
^
```
Full log: https://github.com/r-windows/rtools-backports/pull/35/checks?check_run_id=1691955338
Should I just ignore this and remove the `-Werror` from CMakeLists.txt ? | Error compiling with gcc 4.9.3 | https://api.github.com/repos/strukturag/libheif/issues/421/comments | 3 | 2021-01-13T00:57:06Z | 2021-01-13T09:55:18Z | https://github.com/strukturag/libheif/issues/421 | 784,701,934 | 421 |
[
"strukturag",
"libheif"
]
| https://jpeg.org/jpeg2000/index.html
_Part 16 specifies the carriage of JPEG 2000 codestreams in ISO/IEC 23008-12, commonly referred to as HEIF. A revision is underway to support more flexible wrapping of all JPEG 2000 codestreams, including HTJ2K._ | Where can user find jpeg2000 compatible with heif container? | https://api.github.com/repos/strukturag/libheif/issues/420/comments | 5 | 2021-01-07T21:41:52Z | 2023-12-17T06:51:15Z | https://github.com/strukturag/libheif/issues/420 | 781,629,617 | 420 |
[
"strukturag",
"libheif"
]
| I tried converting HEIC images to JPG using heif-convert on libheif 1.6.1, installed on Ubuntu 20.04.1 LTS via apt install libheif-example package. Also cloned the recent 1.10.0 version, successfully compiled libheif with jpeg support. Used the provided heif-convert under the examples folder with the same result as below:
When I didn't edit the HEIC image and just directly convert, it runs fine.
But when I did some markup like using opaque boxes to redact information through the iPhone device, then convert with heif-convert on my PC, it fails to detect the marked up image as an "HEIF file". | HEIC image marked up on iPhone not detected as an HEIF file | https://api.github.com/repos/strukturag/libheif/issues/418/comments | 1 | 2021-01-06T04:17:20Z | 2021-01-07T17:04:55Z | https://github.com/strukturag/libheif/issues/418 | 779,992,246 | 418 |
[
"strukturag",
"libheif"
]
| The following snippet shows the problem. It only occurs with some images.
int stride=0;
const uint8_t* decoded_pic = heif_image_get_plane_readonly(img, heif_channel_interleaved, &stride);
int Height = heif_image_handle_get_height(handle);
int Width = heif_image_handle_get_width(handle);
Accessing decoded_pic[stride*Height-1] sometimes gives an access violation on Windows 10. It sometimes happens with much smaller indices too. This is with libheif ver 1.9.1 and libde265 frame-parallel branch. Unfortunately I cannot upload a sample image as it comes from a client and I cannot share it.
I have noticed that the stride returned is sometimes larger than 3 times the width, even when rounding upwards to the nearest 32-bit boundary.
Is there a method to query the size of the returned buffer? | heif_image_get_plane_readonly sometimes returns a buffer that is too small to contain the image data | https://api.github.com/repos/strukturag/libheif/issues/417/comments | 16 | 2021-01-05T14:06:55Z | 2021-01-12T08:17:09Z | https://github.com/strukturag/libheif/issues/417 | 779,074,616 | 417 |
[
"strukturag",
"libheif"
]
|

please someone find out why as most of the files are converted | Some files are Not Converted properly Example this one | https://api.github.com/repos/strukturag/libheif/issues/416/comments | 1 | 2021-01-05T05:41:29Z | 2021-01-07T17:24:31Z | https://github.com/strukturag/libheif/issues/416 | 778,602,987 | 416 |
[
"strukturag",
"libheif"
]
| https://gitlab.gnome.org/GNOME/gimp/-/jobs/1065475/raw | libheif 1.10.0 broke gimp windows build | https://api.github.com/repos/strukturag/libheif/issues/414/comments | 9 | 2021-01-03T16:48:08Z | 2021-01-07T17:48:49Z | https://github.com/strukturag/libheif/issues/414 | 777,674,743 | 414 |
[
"strukturag",
"libheif"
]
| Hello,
I have this message error when I add "libde265.lib" in CMAKE
`Error LNK2019 unresolved external symbol __imp_de265_free_decoder referenced in function "void __cdecl libde265_free_decoder(void *)" `
Thanks | LNK2019 libde265_free_decoder(void *) | https://api.github.com/repos/strukturag/libheif/issues/413/comments | 5 | 2021-01-01T08:58:00Z | 2021-01-02T15:37:58Z | https://github.com/strukturag/libheif/issues/413 | 777,246,346 | 413 |
[
"strukturag",
"libheif"
]
| Trying to convert an iPhone 12 Pro HEIC image using 1.10.0 `heif-convert` built-in tool results in
```
$ heif-convert IMG_3005.HEIC IMG_3005.png
File contains 1 images
Could not decode image: 0: Unsupported feature: Unsupported codec
```
while `heif-info` shows:
```
$ heif-info IMG_3005.HEIC
MIME type: image/heic
image: 3024x4032 (id=49), primary
color profile: prof
alpha channel: no
depth channel: yes
(576x768)
z-near: undefined
z-far: undefined
d-min: 0.167725
d-max: 2.292969
representation: uniform disparity
disparity_reference_view: 0
```
Is this due to some oddity in Apple saved images or is there a problem on my setup?
I built libheif from 1.10.0 tag using libjpeg-turbo 2.0.6 and libpng 1.6.37 on a Void Linux (glibc) system. | Cannot convert HEIC image | https://api.github.com/repos/strukturag/libheif/issues/412/comments | 2 | 2020-12-28T22:38:49Z | 2020-12-29T14:17:54Z | https://github.com/strukturag/libheif/issues/412 | 775,614,048 | 412 |
[
"strukturag",
"libheif"
]
| Any idea why `hg clone --branch stable http://hg.videolan.org/x265 x265` results in a timeout?
The server of x265 is down? | Cannot download x265 | https://api.github.com/repos/strukturag/libheif/issues/410/comments | 2 | 2020-12-25T13:56:04Z | 2020-12-26T06:20:48Z | https://github.com/strukturag/libheif/issues/410 | 774,736,243 | 410 |
[
"strukturag",
"libheif"
]
| How to reproduce:
- the input image [here](https://fft.cloud.iqiyi.com/s/b1vDR4G?direct=1&access=5u3io3) saved to **alpha.png**
- ./heif-enc alpha.png -o alpha_1_10.heic
- ./heif-enc alpha.png -o alpha_1_9.heic
Issue:
Within v1.10.0 release, the generated heic image "alpha_1_10.heic"
- In IOS: can not be loaded
- In MAC: can not be loaded
Within v1.9.1 release, the generated heic image "alpha_1_9.heic"
- In IOS: can be loaded, but alpha effect doens't work totally(airdrop the .png and .heic file to iphone, save them in "file" application. And there are different appearance in the background for them).
- In MAC: can be loaded, alpha effect work well.
| alpha image can not be decoded correctly on IOS and Mac | https://api.github.com/repos/strukturag/libheif/issues/409/comments | 2 | 2020-12-25T09:39:24Z | 2021-01-14T08:29:37Z | https://github.com/strukturag/libheif/issues/409 | 774,694,487 | 409 |
[
"strukturag",
"libheif"
]
| Hi there,
I'm using `libheif-1.10.0` on Linux with libaom. There is a jpeg example that when I encode loosing sharpness around the edges. I tried both lossy and lossless modes.
Command I was using to encode the original jpeg:
```
./heif-enc -A -o ./asis3.avif ./asis3.jpeg
./heif-enc -L -A -o ./asis3_lossless.avif ./asis3.jpeg
```
I'm attaching original JPEG and AVIFs to the ticket. | Image quality gets worse when encoding to AVIF (including lossless) | https://api.github.com/repos/strukturag/libheif/issues/407/comments | 16 | 2020-12-23T00:19:11Z | 2021-10-24T20:56:05Z | https://github.com/strukturag/libheif/issues/407 | 773,330,157 | 407 |
[
"strukturag",
"libheif"
]
| The `heif_image_handle_get_auxiliary_type` method should have accompanying `heif_auxiliary_type_free` method.
Currently, callers of `heif_image_handle_get_auxiliary_type` must use the C runtime `free` method.
This is problematic when libheif is compiled as a Windows DLL, `malloc` and `free` are only guaranteed to work when called from the same DLL. | heif_image_handle_get_auxiliary_type needs a free method | https://api.github.com/repos/strukturag/libheif/issues/406/comments | 1 | 2020-12-22T22:18:12Z | 2021-01-07T17:02:31Z | https://github.com/strukturag/libheif/issues/406 | 773,286,395 | 406 |
[
"strukturag",
"libheif"
]
| Hi, I'm the leader of OpenImageIO, a downstream consumer of libheif.
My tests started failing when Homebrew bumped to the new 1.10.0 release. When writing heic files, I end up with a corrupted or possibly truncated file that can't be read properly by either my software or by MacOS's Preview.app.
I was able to narrow down the specific commit: 1449f182e0, dated Nov 13, which has the comment "only wrap heif image in grid if it has an odd size". Building at that commit fails, whereas the immediately prior commit (45f708220c) works for me.
I thought maybe some of the APIs changed or that just some code paths broke in a very specific way. I happen to use the C++ API and thought maybe that was the problem, so tonight I recoded my heic writer using only your C API. That did not help.
I also suspected that perhaps my use of interleaved channels (heif_channel_interleaved, etc.) was the culprit, so I changed that to have non-interleaved, separately heif_image_add_plane for each channel, but that also did not solve the problem.
I don't have a lot of heic images to test with, so I can't give you a comprehensive rundown of all parameters that break, or if it's only a subset of files that have problems. But if it helps, the image I'm writing when it corrupts the file is 8 bits per channel, RGB. I don't get any exceptions (when using the C++ API), nor any non-OK error return codes (when using the C API). All calls appear to succeed, but the resulting file is invalid somehow. It's not just that the pixels are messed up... it seems to result in an invalid heic file entirely -- Apple Preview.app opens a dialog saying that it couldn't read and "It may be damaged or use a file format that Preview doesn’t recognize", and my reading software as I said does not detect any errors returned from libheif but nonetheless ends up with a nonsensical header data (0 pixels wide, and other fields missing or obviously wrong). And in both cases, the failure is 100% reproducible, it does not appear to be sporadic, like you might see for an uninitialized variable or other undefined behavior.
I'm afraid I don't know anything about libheif internals, so this is about as far as I've been able to trace things. But perhaps knowing on which commit things started to break and with the other breadcrumbs I've left, somebody on your dev team can look at the diffs for that checkin and spot the likely culprit.
I haven't tried on platforms other than Mac, but I can also build for Linux and try there if that would help you narrow things down. Also, if it helps you, I can send you one of the corrupted files. Just let me know if there's more I can do to point you in the right direction.
| heic write broken in latest release | https://api.github.com/repos/strukturag/libheif/issues/405/comments | 15 | 2020-12-20T07:56:29Z | 2021-02-03T21:07:28Z | https://github.com/strukturag/libheif/issues/405 | 771,535,953 | 405 |
[
"strukturag",
"libheif"
]
| Is it intentional that `libheif-dev` from the PPAs provided by https://launchpad.net/~strukturag doesn't depend on `libaom-dev`, `libde265-dev` and `libx265-dev`?
It could cause issues with pkg-config when these dependencies are not explicitly installed, see for details:
<details>
<summary>Details</summary>
```Dockerfile
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y \
&& apt-get install -y \
pkg-config \
software-properties-common \
&& apt-add-repository -y ppa:strukturag/libheif \
&& apt-add-repository -y ppa:strukturag/libde265 \
&& apt-get install -y libheif-dev
# libheif-dev should probably also install libaom-dev, libde265-dev and libx265-dev
RUN pkg-config --exists --print-errors "libheif >= 1.3.0" \
&& echo "pkg-config succeeded" \
|| echo "pkg-config failed"
# Helps debugging
RUN ldd /usr/lib/x86_64-linux-gnu/libheif.so \
&& cat /usr/lib/x86_64-linux-gnu/pkgconfig/libheif.pc | grep "Requires.private"
RUN apt-get install -y \
libaom-dev \
libde265-dev \
libx265-dev
RUN pkg-config --exists --print-errors "libheif >= 1.3.0" \
&& echo "pkg-config succeeded" \
|| echo "pkg-config failed"
```
```bash
$ pkg-config --exists --print-errors "libheif >= 1.3.0" && echo "pkg-config succeeded" || echo "pkg-config failed"
Package aom was not found in the pkg-config search path.
Perhaps you should add the directory containing `aom.pc'
to the PKG_CONFIG_PATH environment variable
Package 'aom', required by 'libheif', not found
pkg-config failed
$ ldd /usr/lib/x86_64-linux-gnu/libheif.so
linux-vdso.so.1 (0x00007ffeccf10000)
libaom.so.2 => /usr/lib/x86_64-linux-gnu/libaom.so.2 (0x00007f1ff328a000)
libde265.so.0 => /usr/lib/x86_64-linux-gnu/libde265.so.0 (0x00007f1ff2fe5000)
libx265.so.146 => /usr/lib/x86_64-linux-gnu/libx265.so.146 (0x00007f1ff2364000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1ff2145000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1ff1dbc000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1ff1a1e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1ff162d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1ff3c86000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1ff1415000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1ff1211000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f1ff1006000)
$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/libheif.pc | grep "Requires.private"
Requires.private: aom libde265 x265
$ apt-get install -y libaom-dev libde265-dev libx265-dev
$ pkg-config --exists --print-errors "libheif >= 1.3.0" && echo "pkg-config succeeded" || echo "pkg-config failed"
pkg-config succeeded
```
</details>
(This is most likely due to that transitive dependencies of libheif are now listed in the `Requires.private` field within the `libheif.pc` file) | PPA: libheif-dev has missing dependencies? | https://api.github.com/repos/strukturag/libheif/issues/404/comments | 1 | 2020-12-19T12:44:47Z | 2021-01-05T10:02:39Z | https://github.com/strukturag/libheif/issues/404 | 771,374,492 | 404 |
[
"strukturag",
"libheif"
]
| I don't know what I'm doing wrong, but 10/12bit photos don't decode.
https://github.com/videolan/dav1d/pull/2
`heifenc.exe image_21447_48bit.png -v -L -q 100 -b 12 --avif --no-alpha -p chroma=444 --full_range_flag=1 --enable-two-colr-boxes --matrix_coefficients=0 -o image_21447_36bit.avif`
`heifdec_16bit.exe image_21447_36bit.avif image_21447_36bita.png // -DCONFIG_16BPC -DBITDEPTH=16`
The program goes straight to DOS. | 10/12bit avif photos won't decode | https://api.github.com/repos/strukturag/libheif/issues/403/comments | 0 | 2020-12-16T09:06:54Z | 2020-12-16T09:06:54Z | https://github.com/strukturag/libheif/issues/403 | 768,609,827 | 403 |
[
"strukturag",
"libheif"
]
| Original image:
<img width="200" alt="" src="https://user-images.githubusercontent.com/10688522/102064068-dcd6c080-3e1c-11eb-9b09-83dbe76050c9.png">
Distorted decode in https://strukturag.github.io/libheif/:
<img width="400" alt="" src="https://user-images.githubusercontent.com/10688522/102070014-8e2d2480-3e24-11eb-97e6-d3ff349c4db4.png">
Download HEIC image: [IMG_8099.heic.zip](https://github.com/strukturag/libheif/files/5688127/IMG_8099.heic.zip) (it's in zip because GitHub doesn't allow HEIC uploads) | Images from Apple devices are distorted when parsed by libheif | https://api.github.com/repos/strukturag/libheif/issues/401/comments | 6 | 2020-12-14T10:25:01Z | 2020-12-17T07:42:55Z | https://github.com/strukturag/libheif/issues/401 | 766,255,431 | 401 |
[
"strukturag",
"libheif"
]
| When I add matrix coefficients equal to zero the files are twice as large. I don't know why.
https://github.com/link-u/avif-sample-images/blob/master/hato.png
heifenc -v -b 8 -L -e x265 -p preset=placebo -p chroma=444 -p x265:psy-rd=0 -p x265:ctu=64 input_image -o heif_image
Why can I not convert 16bit png to 8bit heif? | Heif photo size problem. | https://api.github.com/repos/strukturag/libheif/issues/400/comments | 3 | 2020-12-10T09:06:35Z | 2021-01-07T20:13:20Z | https://github.com/strukturag/libheif/issues/400 | 761,049,579 | 400 |
[
"strukturag",
"libheif"
]
| `HeifFile::read_from_file` is going to need to pass UTF-16 in a `wchar_t*` into Microsoft's non-standard `ifstream` constructor, otherwise all you can use is ANSI paths.
I propose we treat the input `const char*` as UTF-8 and add a conversion.
The whole thing can be wrapped in a macro so as not to affect other platforms at all. | Cannot load from non-ANSI paths on Windows | https://api.github.com/repos/strukturag/libheif/issues/398/comments | 1 | 2020-12-09T16:05:52Z | 2020-12-15T11:16:42Z | https://github.com/strukturag/libheif/issues/398 | 760,459,744 | 398 |
[
"strukturag",
"libheif"
]
| Hello. I would like describe an issue, which I run into using this libheif/
Pre story: For few years, I used my mac to generate content for iOS application. Content is heic images. And everything was fine till this BigSur update. Reason is simple: after I updated on BigSur images which i generate on mac, can't be opened in iOS app running on iOS 12. For now both sides used native tools: CGImage, etc
I saw 1 different in `heif-info` tool response
With old images, generated on catalina - `color profile: no`
But with BigSur generating ` color profile: nclx`
So I logically assumed that this is an issue. And I tried use this library on macOS instead of native one. I hoped that I will be able to avoid setting random color profile, but this lib also set by default `nclx` color profile. And no way to ask set nothing.
And I prefer avoid using libheif in iOS app, since it will be simpler switch to jpg instead of heic.
Could you advice the way to not set random/default `color profile` using this library? | Issue with color_profile on iOS | https://api.github.com/repos/strukturag/libheif/issues/397/comments | 13 | 2020-12-09T00:20:16Z | 2023-12-24T08:54:49Z | https://github.com/strukturag/libheif/issues/397 | 759,885,666 | 397 |
[
"strukturag",
"libheif"
]
| iOS can generate multiple auxC entries; some are depth maps, others are gain correction, etc. (See issue #389) Each of these can have their own color profile (colr; ICC Profile).
The functions heif_image_handle_get_raw_color_profile and heif_image_handle_get_raw_color_profile_size appears to return the last colr (ICC Profile) in the file, and not the one associated with the image (as defined in the ipma record).
In practice with iOS: when there are multiple auxC records, the first colr is the standard iOS color profile, but the auxC records use a different grayscale color profile. heif_image_handle_get_raw_color_profile returns the grayscale profile for the main image rather than the color profile. | heif_image_handle_get_raw_color_profile returns wrong color profile | https://api.github.com/repos/strukturag/libheif/issues/391/comments | 3 | 2020-11-29T18:17:55Z | 2020-12-15T13:49:08Z | https://github.com/strukturag/libheif/issues/391 | 752,974,619 | 391 |
[
"strukturag",
"libheif"
]
| The README file says:
> This library uses a standard autoconf/automake build system
but CMakeLists.txt is also present.
Why doesn't README recommend cmake? | Is cmake build stable? | https://api.github.com/repos/strukturag/libheif/issues/390/comments | 1 | 2020-11-29T01:22:28Z | 2020-12-15T14:00:01Z | https://github.com/strukturag/libheif/issues/390 | 752,805,998 | 390 |
[
"strukturag",
"libheif"
]
| Related to issue 386:
I have a few instances of HEIC images with unsupported auxC types.
The types I have observed so far:
```
urn:com:apple:photo:2020:aux:hdrgainmap
urn:com:apple:photo:2020:aux:semanticglassesmatte
urn:com:apple:photo:2019:aux:semanticchairmatte
urn:com:apple:photo:2019:aux:semanticskinmatte
urn:com:apple:photo:2019:aux:semanticteethmatte
urn:com:apple:photo:2018:aux:portraiteffectsmatte
```
I modified libheif/heif_context.cc function HeifContext::interpret_heif_file() to recognize these types as depth maps.
```
// depth channel
if ((auxC_property->get_aux_type() == "urn:mpeg:hevc:2015:auxid:2") || // HEIF
(auxC_property->get_aux_type() == "urn:com:apple:photo:2020:aux:hdrgainmap") || // Apple
(auxC_property->get_aux_type() == "urn:com:apple:photo:2020:aux:semanticglassesmatte") || // Apple
(auxC_property->get_aux_type() == "urn:com:apple:photo:2019:aux:semanticchairmatte") || // Apple
(auxC_property->get_aux_type() == "urn:com:apple:photo:2019:aux:semanticskinmatte") || // Apple
(auxC_property->get_aux_type() == "urn:com:apple:photo:2019:aux:semanticteethmatte") || // Apple
(auxC_property->get_aux_type() == "urn:com:apple:photo:2018:aux:portraiteffectsmatte") || // Apple
(auxC_property->get_aux_type() == "urn:mpeg:mpegB:cicp:systems:auxiliary:depth")) { // AVIF
```
I have some examples that list multiple HEIC "auxC" images. However, heif_image_handle_get_number_of_depth_images() only returns "1", even if there is one or more present. Moreover, heif_image_handle_get_list_of_depth_image_IDs() only returns the ID of the last one listed.
Since the two example images that I have show people's faces (and I don't known them or have permission), I'm hesitant to post the pictures here. However, I am attaching the "heif-info -d" listing for one of the pictures.
What I want/hope/expect:
- A function to list all of these auxC images, and not just the last one. (There are functions for thumbs and functions for depth maps. We need functions for generic aux images.)
- Probably should be cause 'aux' rather than 'depth', since most of these do not appear to be depth maps.
- If there are multiple depth maps, the the get_number_of_depth_images() function should return all of them, not just the last one.
- The aux list should probably be generic since Apple appears to revise the auxC type. Either "starts with urn:com\:\apple\:photo:" or "if it's not a top level and not a thumb, then it's an aux."
[8ad6bb96.txt](https://github.com/strukturag/libheif/files/5611316/8ad6bb96.txt)
| libheif unable to extract multiple auxC images | https://api.github.com/repos/strukturag/libheif/issues/389/comments | 4 | 2020-11-28T22:31:48Z | 2020-12-15T13:50:02Z | https://github.com/strukturag/libheif/issues/389 | 752,781,854 | 389 |
[
"strukturag",
"libheif"
]
| Hi!
I have some heif images generated by an Iphone that the alpha channel has 1 pixel more than the other rgb channels,
rgb channels have `3690x2674` and the alpha has `3691x2674`.
This make the code return an Unsupported color conversion error due to this condition:
https://github.com/strukturag/libheif/blob/master/libheif/heif_colorconversion.cc#L3043
```c
// alpha image should have full image resolution
if (input->has_channel(heif_channel_Alpha)) {
if (input->get_width(heif_channel_Alpha) != width ||
input->get_height(heif_channel_Alpha) != height) {
return nullptr;
}
}
```
The image is fine, I can see it in multiple viewers such as mac viewer, gimp and photoshop.
After debugging why I was getting the error I got to this line:
https://github.com/strukturag/libheif/blob/master/libheif/heif_context.cc#L1216
```c
// TODO: check that sizes are the same and that we have an Y channel
// BUT: is there any indication in the standard that the alpha channel should have the same size?
```
And I've tested forcing the alpha to be restricted to maximum the image size, and libheif processes the image fine.
I still don't know if it's a good idea, checking the standard I did not find any specification about that so I don't know if I should propose a PR (I've already have the code in place) or discard this images and consider them as corrupted image.
Keeping in mind that viewers consider this images as valid probably I'd go with limiting the alpha channel size to the maximum allowed. What do you think?
Thanks for the great work and this awesome library! | Issue regarding alpha channel with width bigger than rgb channels width | https://api.github.com/repos/strukturag/libheif/issues/388/comments | 6 | 2020-11-25T23:24:40Z | 2020-12-18T19:00:29Z | https://github.com/strukturag/libheif/issues/388 | 751,173,423 | 388 |
[
"strukturag",
"libheif"
]
| Trying to get pyheif working on the Raspberry Pi. In the end I have downloaded libheif-1.9.1 from here and compiled and installed it apprently OK (some warnings could have slipped by!). But when I try to import pyheif module in python I get
```
ImportError: /usr/local/lib/python3.7/dist-packages/_libheif_cffi.abi3.so: undefined symbol: heif_image_handle_get_raw_color_profile
```
If I try to convert an heic file using `heif-convert` I get
```bash
$ heif-convert -q 90 ~/Pictures/heif/sample1.heic /dev/shm/sample1.png
heif-convert: symbol lookup error: heif-convert: undefined symbol: heif_check_filetype
```
These work OK on the apt install version on this ubuntu laptop. | on Raspberry Pi keep getting symbol lookup errors | https://api.github.com/repos/strukturag/libheif/issues/387/comments | 0 | 2020-11-24T17:30:37Z | 2020-11-24T17:30:37Z | https://github.com/strukturag/libheif/issues/387 | 749,905,527 | 387 |
[
"strukturag",
"libheif"
]
| I have a HEIC from an iPhone 12. No special processing for features enabled.
The iref lists 5 IDs:
ID=49 is 'dimg' and is dependent on lots of IDs. (Typical.) This is the main image and it decodes without a problem.
ID=50 is 'thmb' and it decodes properly as a thumbnail image.
ID=51 is 'auxl'. It appears to be an image, but I cannot find any decoders in libheif that can extract his image.
- If I pass ID=51 into heif_image_handle_get_thumbnail, it returns heif_error_Usage_error. (Okay, so it isn't a thumbnail.)
- If I pass ID=51 into heif_image_handle_get_depth_image_handle, then heif_image_handle_get_depth_image_handle crashes (segfault).
ID=52 and ID=53 are 'cdsc' (content descriptors). 52 is the cdsc for 51, and 53 is the cdsc for 49 (and it works properly).
How do I extract the image from ID=51 'auxl'?
Running heif-info does not identify auxl as a depth map or thumbnail.
```
MIME type: image/heic
image: 3024x4032 (id=49), primary
thumbnail: 240x320
color profile: prof
alpha channel: no
depth channel: no
```
| Cannot extract auxl and depth_image_handle crashes. | https://api.github.com/repos/strukturag/libheif/issues/386/comments | 10 | 2020-11-24T16:48:43Z | 2020-11-30T18:20:30Z | https://github.com/strukturag/libheif/issues/386 | 749,874,864 | 386 |
[
"strukturag",
"libheif"
]
| I can't decode avif photo. I don't know what I'm doing wrong.
I use library:
https://www.sendspace.com/file/3glokx
Encoder works and create file but decoder has error. `Could not decode image: 0: Invalid input: Unspecified: Success`
`heifenc_08bit_hdr.exe image_21447.y4m -v --avif --no-alpha -p chroma=444 -q 68 -o image_21447.avif`
`heifdec.exe image_21447.avif 111.png`
File info works:
`heifinfo.exe image_21447.avif`
https://www.sendspace.com/file/o4j39m | Problem with decoder AVIF | https://api.github.com/repos/strukturag/libheif/issues/384/comments | 2 | 2020-11-22T12:51:04Z | 2022-05-05T10:15:22Z | https://github.com/strukturag/libheif/issues/384 | 748,236,198 | 384 |
[
"strukturag",
"libheif"
]
| Thanks to https://strukturag.github.io/libheif/libheif.js - I am able to display HEIC files on the canvas. But I can't work out how to read metadata from the file.
Is there a JS API for reading EXIF?
Thanks! | Read EXIF in Javascript? | https://api.github.com/repos/strukturag/libheif/issues/383/comments | 3 | 2020-11-20T20:42:29Z | 2020-11-30T16:54:46Z | https://github.com/strukturag/libheif/issues/383 | 747,781,119 | 383 |
[
"strukturag",
"libheif"
]
| I hate to waste people's time here, but I have searched for a solution and experimented for many hours in vain. The issue: libheif will not compile. I have compiled and installed libde256 and installed the x256 package. Autogen.sh and configure work fine, but when I `sudo make`, I get the following:
make[2]: *** [Makefile:1171: libheif_la-heif.lo] Error 1
make[2]: Leaving directory '/usr/src/libheif/libheif'
make[1]: *** [Makefile:536: all-recursive] Error 1
make[1]: Leaving directory '/usr/src/libheif'
make: *** [Makefile:445: all] Error 2
Further, when I run `sudo make --debug`, I get the following:
Updating goal targets....
File 'all' does not exist.
File 'all-am' does not exist.
File 'libheif.la' does not exist.
File 'libheif_la-heif.lo' does not exist.
Must remake target 'libheif_la-heif.lo'.
There are other such similar "errors" output prior to the above. I say "errors" because I'm not sure they qualify as such. Thank you in advanced for any help. I just hope I haven't foolishly overlooked something trivial detail.
EDIT: I'm running Ubuntu 20.10 | Compile error | https://api.github.com/repos/strukturag/libheif/issues/382/comments | 2 | 2020-11-19T17:38:00Z | 2020-11-19T18:03:12Z | https://github.com/strukturag/libheif/issues/382 | 746,790,404 | 382 |
[
"strukturag",
"libheif"
]
| ```
root@debian:~# uname -a
Linux debian 4.19.0-9-arm64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) aarch64 GNU/Linux
root@debian:~# ls
IMG_2052.HEIC
root@debian:~# file IMG_2052.HEIC
IMG_2052.HEIC: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile
root@debian:~# heif-convert IMG_2052.HEIC IMG_2052.jpg
File contains 1 images
Written to IMG_2052.jpg
heif-convert: image.cc:315: de265_error de265_image::alloc_image(int, int, de265_chroma, std::shared_ptr<const seq_parameter_set>, bool, decoder_context*, encoder_context*, de265_PTS, void*, bool): Assertion `sps->SubWidthC == SubWidthC' failed.
Aborted
```
[Asciinema recording](https://asciinema.org/a/3GSUT7x5XgM86wJUTRc92Cito)
- Aarch64 Debian running in QEMU
- `libheif1` and `libheif-examples` installed via apt
- Happens in 100% cases when processing iPhone Portrait photos with auxiliary depth image, which seems to be the point when the crash happens.
- Processing of the same problematic photos works fine on macOS and WSL | Official Debian Buster package out of date | https://api.github.com/repos/strukturag/libheif/issues/381/comments | 1 | 2020-11-17T20:11:32Z | 2020-11-17T20:26:21Z | https://github.com/strukturag/libheif/issues/381 | 745,052,537 | 381 |
[
"strukturag",
"libheif"
]
| When I wanted to make a patch for libheif (#379), I got stuck because `git commit` (and all variants adding files first, or with `-a`, I tested so much…) was immediately returning with code 1 and no output whatsoever. As I just upgraded my machine, I even thought that `git` broke (but I could commit on every other repository).
I finally discovered that the autogen.sh installs a pre-commit hook (`.git/hooks/pre-commit`), which itself calls `./scripts/cpplint.py`. The problem is this cpplint.py. First of all, it looks like it still uses Python 2 (which was not installed on my machine as it's now deprecated and distributions don't ship it by default, or now even at all for some). So it would need to be ported.
At the very least, there should be a warning somewhere. Maybe the pre-commit hook could check for Python 2 existence and write an error if absent. Also cpplint.py shebang should be `#!/usr/bin/env python2` until it's ported (many distributions now symlink `python` to `python3`; `python` should be reserved for scripts both python 2 and 3 compatible).
Ah and by the way, the reason for which `git commit` was silent (which was the most annoying thing, I wasted a lot of time on this issue) was because of:
```
# Change stderr to write with replacement characters so we don't die
# if we try to print something containing non-ASCII characters.
sys.stderr = codecs.StreamReaderWriter(sys.stderr,
codecs.getreader('utf8'),
codecs.getwriter('utf8'),
'replace')
```
Apparently this is about encoding (cf. comment), but when run with Python 3, it just make stderr disappear, which was very bad, because we cannot see the Python errors when the script crashed. | The pre-commit hook prevents to commit without a word | https://api.github.com/repos/strukturag/libheif/issues/380/comments | 0 | 2020-11-17T15:24:57Z | 2021-01-29T10:57:00Z | https://github.com/strukturag/libheif/issues/380 | 744,836,681 | 380 |
[
"strukturag",
"libheif"
]
| Pretty much the same as https://github.com/strukturag/libheif/issues/377, but for different file and with different error:
```
$ heif-info alpha_video.avif
MIME type: image/avif-sequence
Could not read HEIF/AVIF file: Invalid input: Non-existing item ID referenced: Non-existing alpha image referenced
```
This file opens fine in gwenview (with qt-avif-image-plugin installed) and also chromium as well.
To reproduce:
```
git clone https://github.com/AOMediaCodec/av1-avif
cd av1-avif/testFiles/Netflix/avis
heif-info alpha_video.avif
```
OS: ArchLinux x86_64
libheif version: 1.9.1
aom version: 2.0.0
dav1d version: 0.7.1
ImageMagick issue which led to me making this issue: ImageMagick/ImageMagick#2788
Relevant tree at the time of writing this issue: https://github.com/AOMediaCodec/av1-avif/tree/3fb01d066368fc09d86651c1034bcb7a84ca0715/testFiles/Netflix/avis | Reading animated AVIF with alpha fails with error: Invalid input: Non-existing item ID referenced: Non-existing alpha image referenced | https://api.github.com/repos/strukturag/libheif/issues/378/comments | 0 | 2020-11-16T16:16:27Z | 2020-11-16T16:16:27Z | https://github.com/strukturag/libheif/issues/378 | 743,966,808 | 378 |
[
"strukturag",
"libheif"
]
| When trying to read animated AVIF file `Chimera-AV1-10bit-480x270.avif` from https://github.com/AOMediaCodec/av1-avif repository with `heif-info`, it fails with error:
```
$ heif-info Chimera-AV1-10bit-480x270.avif
MIME type: image/avif-sequence
Could not read HEIF/AVIF file: Unsupported file-type: Unspecified: File does not include any supported brands.
```
This file opens fine in gwenview (with [qt-avif-image-plugin](https://github.com/novomesk/qt-avif-image-plugin) installed) and also chromium.
Also note that `image/avif-sequence` was removed from spec, see https://github.com/AOMediaCodec/av1-avif/issues/59 and https://github.com/AOMediaCodec/av1-avif/pull/86.
To reproduce:
```
git clone https://github.com/AOMediaCodec/av1-avif
cd av1-avif/testFiles/Netflix/avis
heif-info Chimera-AV1-10bit-480x270.avif
```
OS: ArchLinux x86_64
libheif version: 1.9.1
aom version: 2.0.0
dav1d version: 0.7.1
ImageMagick issue which led to me making this issue: https://github.com/ImageMagick/ImageMagick/issues/2788
Relevant tree at the time of writing this issue: https://github.com/AOMediaCodec/av1-avif/tree/3fb01d066368fc09d86651c1034bcb7a84ca0715/testFiles/Netflix/avis | Reading animated AVIF fails with error: Unsupported file-type: Unspecified: File does not include any supported brands. | https://api.github.com/repos/strukturag/libheif/issues/377/comments | 5 | 2020-11-16T16:06:24Z | 2024-07-31T13:32:27Z | https://github.com/strukturag/libheif/issues/377 | 743,959,055 | 377 |
[
"strukturag",
"libheif"
]
| Hi,
First of all, thank you for your work on this great library.
Now, I would like to access depth data embedded in a .heic file using libheif.js, but it seems that the JavaScript version is not currently capable of that?
In the `heif_convert.cc` I saw the following line of code at the beginning of the section taking care of depth map extraction:
`int has_depth = heif_image_handle_has_depth_image(handle);`
In the `libheif.js` demo there is this part that takes care of image decoding:
```
HeifDecoder.prototype.decode = (function(buffer) {
if (this.decoder) {
libheif.heif_context_free(this.decoder)
}
this.decoder = libheif.heif_context_alloc();
if (!this.decoder) {
console.log("Could not create HEIF context");
return []
}
var error = libheif.heif_context_read_from_memory(this.decoder, buffer);
if (error.code !== libheif.heif_error_Ok) {
console.log("Could not parse HEIF file", error);
return []
}
var count = libheif.heif_context_get_number_of_top_level_images(this.decoder);
if (!count) {
console.log("No images found");
return []
}
var result = [];
for (var i = 0; i < count; i++) {
var handle = libheif.heif_js_context_get_image_handle(this.decoder, i);
console.log(libheif.heif_image_handle_has_depth_image(handle)); // <-----------------------------------
if (!handle || handle.code) {
console.log("Could not get image data for id", i, handle);
continue
}
result.push(new HeifImage(handle))
}
return result
});
```
As all other functions seem to have identical names between the C and JS versions, I tried to sneak in the `heif_image_handle_has_depth_image` function.
Unfortunately it failed with the following error:
`Uncaught TypeError: libheif.heif_image_handle_has_depth_image is not a function`
I also tried `heif_js_image_handle_has_depth_image`, but got the same error.
How does one access depth data using libheif.js? | Extracting depth data using libheif.js | https://api.github.com/repos/strukturag/libheif/issues/376/comments | 0 | 2020-11-15T16:29:57Z | 2020-11-15T16:30:57Z | https://github.com/strukturag/libheif/issues/376 | 743,292,292 | 376 |
[
"strukturag",
"libheif"
]
| my command:
./examples/heif-convert ./kimono.crop.avif ./out.png
Link to file:
https://github.com/AOMediaCodec/av1-avif/blob/master/testFiles/Link-U/kimono.crop.avif
Output:
File contains 1 images
Could not decode image: 0: Invalid input: Invalid clean-aperture specification
| Error converting avif file with a clap box | https://api.github.com/repos/strukturag/libheif/issues/374/comments | 3 | 2020-11-12T17:46:39Z | 2020-11-12T22:24:01Z | https://github.com/strukturag/libheif/issues/374 | 741,800,617 | 374 |
[
"strukturag",
"libheif"
]
| Hoping I'm not reporting something very obvious, but I couldn't find any other reference to the particular issue I have.
I was trying to find a workflow that allows me to store scanned pictures in a higher bit depth than 8, but preferably with a less demanding space requirement than regular 16-bit TIFF or PNG files.
Because Apple somehow disabled exporting 16-bit .heic images (the greyed-out 16-bit option in Preview.app), I eventually found libheif, as described [here](https://www.dpreview.com/forums/thread/4462884).
I'm having some problems, though. Here's what I found, hopefully it's of some use :)
The pictures I scan are mostly old black&white photo negatives, and I first tested with greyscale 16-bit PNG files as input, but I also tried with RGB 16-bit (48 bit) RGB copies of the same images, and made both an odd-sized (1135 x 747) and an even-sized (1136 x 748) version of each.
I first tried with the -E option, like this:
`> heif-enc -E -b 12 -q 90 <input file>`
- **greyscale-odd**: .heic image extremely grainy, left ~ half only, horizontally stretched to original width
- **greyscale-even**: ditto ^
- **colour-odd**: .heic image cropped, only the left 25 % visible (not grainy though); remaining 75% is transparent
- **colour-even**: ditto ^
eventually I tried it without the **-E** option:
`> heif-enc -E -b 12 -q 90 <input file>`
- **greyscale-odd**: `Warning: HEIF images ...` (as expected)
- **greyscale-even**: .heic image extremely grainy, left ~ half only, horizontally stretched to original width
- **colour-odd**: `Warning: HEIF images ...` (as expected)
- **colour-even**: good result!
Using libheif version: 1.9.1, x265 HEVC encoder (0.0)
Mac OS 10.15.7 | Distortion in encoded .heic files | https://api.github.com/repos/strukturag/libheif/issues/373/comments | 37 | 2020-11-09T22:00:21Z | 2020-12-12T16:35:34Z | https://github.com/strukturag/libheif/issues/373 | 739,393,846 | 373 |
[
"strukturag",
"libheif"
]
| Hi, thanks for authors who wrote this lib.
When I'm using `heif-thumbnailer -s [same as original dimension] src_file.heic output_file.heic` in CL, output thumbnail file size large than original file.
- My original file resolution: 2160 × 2880, size: 145KB
- Output thumbnail file resolution: 2160 × 2880, size: 3MB
Is that right? :) | heif-thumbnailer generates output files size large than original file. | https://api.github.com/repos/strukturag/libheif/issues/372/comments | 2 | 2020-11-09T08:39:29Z | 2020-11-09T09:17:12Z | https://github.com/strukturag/libheif/issues/372 | 738,818,756 | 372 |
[
"strukturag",
"libheif"
]
| [cavif-rs.zip](https://github.com/strukturag/libheif/files/5504465/cavif-rs.zip)
Hello,
I received this file from one of the GIMP users, he complained that GIMP cannot open the file.
I get the same error with heif-convert
```
heif-convert UHD-CompressionTest-Leipzig-90-avif.avif output.png
Could not read HEIF/AVIF file: Invalid input: No 'hdlr' box
``` | AVIF encoded via cavif-rs | https://api.github.com/repos/strukturag/libheif/issues/371/comments | 3 | 2020-11-07T08:06:21Z | 2020-11-12T15:44:28Z | https://github.com/strukturag/libheif/issues/371 | 738,196,747 | 371 |
[
"strukturag",
"libheif"
]
| This is required to get the supported values for the rav1e `tile-rows` and `tile-cols` parameters. | Add a heif_encoder_parameter_get_valid_integer_values method | https://api.github.com/repos/strukturag/libheif/issues/368/comments | 1 | 2020-10-31T23:37:17Z | 2020-11-12T16:45:17Z | https://github.com/strukturag/libheif/issues/368 | 733,828,141 | 368 |
[
"strukturag",
"libheif"
]
| Since commit https://github.com/strukturag/libheif/commit/b22820a276d7597f7f633bc57c34c28212701cdb AVIF images smaller than <16 pixels are encoded to 16×16 with cropping. This works great with rav1e, but for some reason it cannot be opened in Chrome when encoding with aom. libvips also seems to fail in processing this image (issue https://github.com/libvips/libvips/issues/1808 might be relevant here).
Test images:
https://t0.nl/x-aom.avif - 10×10 encoded with aom v2.0.0
https://t0.nl/x-rav1e.avif - 10×10 encoded with rav1e v0.3.4
For reference, the images encoded as 16×16:
https://t0.nl/x2-aom.avif
https://t0.nl/x2-rav1e.avif
The test images are generated with:
```bash
# aom v2.0.0
vips crop zebra.jpg x-aom.avif[compression=av1] 0 0 10 10
vips crop zebra.jpg x2-aom.avif[compression=av1] 0 0 16 16
# rav1e v0.3.4
vips crop zebra.jpg x-rav1e.avif[compression=av1] 0 0 10 10
vips crop zebra.jpg x2-rav1e.avif[compression=av1] 0 0 16 16
```
Building a debug build of Chromium reveals this verbose message:
```bash
[29580:29588:1023/105621.829690:VERBOSE1:avif_image_decoder.cc(534)] Frame size "10x10" differs from container size "16x16"
```
https://github.com/chromium/chromium/blob/d3f2d5be6762b18b922d109a19250812ea88f9e0/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc#L534 | <16 pixels encoding issue with aom | https://api.github.com/repos/strukturag/libheif/issues/365/comments | 12 | 2020-10-23T10:28:45Z | 2022-09-05T12:46:42Z | https://github.com/strukturag/libheif/issues/365 | 728,103,775 | 365 |
[
"strukturag",
"libheif"
]
| I have used cmake maked it, It can operate **normally on macos10.9** and above, but when I run
`./heif-convert IMG_3132.HEIC testimg.jpg`
on command line of **macos10.8**, It show logs as blow:
```
File contains 1 images
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /Users/phonepro/Desktop/deployment10.8 2/./libheif.1.9.1.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ____chkstk_darwin
Referenced from: /Users/phonepro/Desktop/deployment10.8 2/./libheif.1.9.1.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
Trace/BPT trap: 5
``` | symbol binding failed on macos10.8 | https://api.github.com/repos/strukturag/libheif/issues/364/comments | 3 | 2020-10-23T10:11:19Z | 2020-11-09T14:20:00Z | https://github.com/strukturag/libheif/issues/364 | 728,092,354 | 364 |
[
"strukturag",
"libheif"
]
| Where can I find each pixel value (x,y,RGB(or other color encoding)) for each image?
I want the raw data, before the conversion to JPEG and etc. it will be used to create cv::mat.
Thanks! | Find each pixel presentation before conversion | https://api.github.com/repos/strukturag/libheif/issues/360/comments | 2 | 2020-10-14T08:03:48Z | 2023-05-30T11:01:13Z | https://github.com/strukturag/libheif/issues/360 | 721,237,476 | 360 |
[
"strukturag",
"libheif"
]
| Hello,
I tried encoding with YUV422 sub-sampling in libheif 1.9.1
When I use 16bit PNG as input, I notice following problem.
```
heif-enc -A -p chroma=422 -o yuv422.avif genessa16.png
heif-convert yuv422.avif yuv422.png
```
Original 16bit PNG genessa16.png :

Result yuv422.png :

| 10bit encoding with chroma=422 problem | https://api.github.com/repos/strukturag/libheif/issues/359/comments | 7 | 2020-10-13T12:33:20Z | 2020-11-03T10:23:29Z | https://github.com/strukturag/libheif/issues/359 | 720,195,071 | 359 |
[
"strukturag",
"libheif"
]
| When libheif master is built on MSYS2 platform (Windows), heif-enc and GIMP plug-in crashes when encoding HEIC files. 8-bit AVIF encoding works.
```
(gdb) run
Starting program: C:\msys64\mingw64\bin\heif-enc.exe genessa_600_450.jpg x.heic
Program received signal SIGSEGV, Segmentation fault.
0x000007fefda85b80 in strlen () from C:\Windows\system32\msvcrt.dll
(gdb) bt
#0 0x000007fefda85b80 in strlen () from C:\Windows\system32\msvcrt.dll
#1 0x000000006ecc5cea in x265_plugin_name ()
at C:/msys64/home/Daniel/libheif/libheif/heif_encoder_x265.cc:190
#2 0x000000006eca58e7 in heif::HeifContext::encode_image (this=0x19b9830,
pixel_image=std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {...}, encoder=encoder@entry=0x19ba050, options=options@entry=0x1a244c0,
input_class=input_class@entry=heif_image_input_class_normal,
out_image=std::shared_ptr<heif::HeifContext::Image> (empty) = {...})
at C:/msys64/mingw64/include/c++/10.2.0/ext/new_allocator.h:79
#3 0x000000006ec9950d in heif_context_encode_image (ctx=ctx@entry=0x19b97e0,
input_image=0x19ba400, encoder=0x19ba050,
options=options@entry=0x1a244c0,
out_image_handle=out_image_handle@entry=0x22fc68)
at C:/msys64/mingw64/include/c++/10.2.0/ext/atomicity.h:97
#4 0x0000000000404105 in main (argc=3, argv=0x1a8af20)
at C:/msys64/mingw64/include/c++/10.2.0/bits/shared_ptr_base.h:1324
```
Other report that problems are since 1.8.0. 1.7.0 worked fine according the reports.
Related issue: https://gitlab.gnome.org/GNOME/gimp/-/issues/5749 | crash during HEIC encoding on MSYS2 platform | https://api.github.com/repos/strukturag/libheif/issues/357/comments | 10 | 2020-10-11T11:02:30Z | 2021-10-04T14:07:22Z | https://github.com/strukturag/libheif/issues/357 | 718,811,777 | 357 |
[
"strukturag",
"libheif"
]
| Hello, since commit https://github.com/strukturag/libheif/commit/f231c7a941d64cb3528f373ae9f0580c61dbb80b included in libheif v1.8.0, the `hdlr` box in output images now always has a name that includes the libheif version and encoder plugin details.
Would you be amenable to making this feature configurable? The current behaviour would remain the default, with the addition of an optional to allow someone to revert to the previous `hdlr` box behaviour without a name.
I'm happy to work on and submit a PR with this change, but would prefer to know beforehand if this is something that the maintainers and/or others would be willing to support.
Thanks, as always, for continuing to improve this very useful library.
| Question: is there interest in making the hdlr box name optional? | https://api.github.com/repos/strukturag/libheif/issues/356/comments | 3 | 2020-10-06T15:46:04Z | 2020-11-13T09:43:44Z | https://github.com/strukturag/libheif/issues/356 | 715,807,550 | 356 |
[
"strukturag",
"libheif"
]
| Hi,
I made two heif files with heif-enc from PNGs with swapped-channel profiles. Gimp 2.10.18 is able to load these files and their profiles just fine, and my local build of heif-info says that indeed, the profiles are inside the file.
However, I cannot seem to figure out how to get the c++ bindings to return any profile at all. `heifImage.get_color_profile_type()` returns 0 and `heifImage.get_raw_color_profile()` returns an empty array (heifImage being the decoded image obtained from the handle).
[swapped_profile.zip](https://github.com/strukturag/libheif/files/5319874/swapped_profile.zip)
Am I doing something wrong, or is the profile just not being passed to the image correctly?
| C++ bindings always report no profile being found. | https://api.github.com/repos/strukturag/libheif/issues/353/comments | 2 | 2020-10-02T19:21:31Z | 2020-10-18T13:17:54Z | https://github.com/strukturag/libheif/issues/353 | 713,849,762 | 353 |
[
"strukturag",
"libheif"
]
| When I try to convert attached PNG to AVIF, this error is thrown.
`heif: Unsupported feature: Unsupported codec (4.3000)`

| Library throws error when converting certain PNG to AVIF | https://api.github.com/repos/strukturag/libheif/issues/352/comments | 1 | 2020-10-01T04:51:08Z | 2020-11-12T18:36:44Z | https://github.com/strukturag/libheif/issues/352 | 712,477,151 | 352 |
[
"strukturag",
"libheif"
]
| I am using the script in node environment. decoded image object is empty.
Log below:
Debugger attached.
Running libheif JavaScript tests ...
test-javascript.js:23
Loaded libheif.js 0.0.1
test-javascript.js:26
Loaded images: 2
test-javascript.js:52
Array(2) [HeifImage, HeifImage]
test-javascript.js:53
length:2
proto:Array(0) [, …]
0:HeifImage {handle: heif_image_handle, img: null}
1:HeifImage {handle: heif_image_handle, img: null} | Trying to use libheif javascript version on server side - decoded object image is empty | https://api.github.com/repos/strukturag/libheif/issues/351/comments | 1 | 2020-09-30T02:55:46Z | 2020-09-30T07:03:23Z | https://github.com/strukturag/libheif/issues/351 | 711,592,973 | 351 |
[
"strukturag",
"libheif"
]
| Hello,
I was trying to encode AVIF with realtime speed:
`heif-enc -A -p speed=6 -p realtime=1 -o z.avif z.png`
the produced z.avif was only 283 bytes, it is obviously incomplete.
heif-info indicate:
```
heif-info z.avif
MIME type: image/avif
Could not read HEIF/AVIF file: Invalid input: Item has no data: Item with ID 1 has no compressed data
``` | realtime parameter in AOM encoder produced incomplete .avif file | https://api.github.com/repos/strukturag/libheif/issues/350/comments | 4 | 2020-09-29T18:50:52Z | 2020-11-02T09:39:54Z | https://github.com/strukturag/libheif/issues/350 | 711,362,949 | 350 |
[
"strukturag",
"libheif"
]
| Hello,
I encoded following 960 x 576 image:

I used following commands:
```
heif-enc -o 10.heif -b 10 good.png
heif-enc -o 12.heif -b 12 good.png
heif-convert 10.heif result10.png
heif-convert 12.heif result12.png
```
At the end I get following images:


| HEIC 10bit and 12bit problem | https://api.github.com/repos/strukturag/libheif/issues/348/comments | 5 | 2020-09-29T11:52:30Z | 2020-11-03T10:09:17Z | https://github.com/strukturag/libheif/issues/348 | 711,037,457 | 348 |
[
"strukturag",
"libheif"
]
| I get updates/upgrades through the [libheif “struktur AG” team PPA on Launchpad](https://launchpad.net/~strukturag/+archive/ubuntu/libheif).
Last week an upgrade was suggested but I get following error when trying to `sudo apt upgrade`:
The following packages have been kept back:
heif-gdk-pixbuf heif-thumbnailer
$ `sudo apt install heif-thumbnailer`
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
heif-thumbnailer : Depends: libheif1 (= 1.9.1-1~ ppa1~ ubuntu20.04.1) but 1.8.0-1 ~ ppa1 ~ ubuntu20.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
_Same for:_
$ `sudo apt install heif-gdk-pixbuf`
Any tips how to resolve this?
(I could not ask a question on the [PPA Launchpad](https://answers.launchpad.net/~strukturag) that is why I post it here.)
| Ubuntu upgrade error | https://api.github.com/repos/strukturag/libheif/issues/347/comments | 6 | 2020-09-29T08:31:16Z | 2022-04-25T07:07:00Z | https://github.com/strukturag/libheif/issues/347 | 710,888,081 | 347 |
[
"strukturag",
"libheif"
]
| When loading an image that stores the CICP values in the bitstream, those values will be lost after the `convert_image` call.
This causes corrupted colors when using the Identity matrix coefficient with an ICC color profile.
I think the fix would be to add an `else if` statement that uses the bitstream NCLX box if the HEIF metadata does not contain one.
Something like:
```C++
if (colorProfileInMetadata) {
img->set_color_profile_nclx(colorProfileInMetadata);
}
else if (nclx && !img->get_color_profile_nclx()) {
img->set_color_profile_nclx(nclx);
}
```
| Bitstream CICP data loss in decode_image_planar | https://api.github.com/repos/strukturag/libheif/issues/346/comments | 3 | 2020-09-29T00:21:08Z | 2020-11-02T23:16:42Z | https://github.com/strukturag/libheif/issues/346 | 710,659,202 | 346 |
[
"strukturag",
"libheif"
]
| do like aom : detect cav1d with its pkg-config file
thank you | feature request: add detection of dav1d if installed on the system | https://api.github.com/repos/strukturag/libheif/issues/340/comments | 3 | 2020-09-25T09:35:33Z | 2020-09-28T10:47:59Z | https://github.com/strukturag/libheif/issues/340 | 708,794,861 | 340 |
[
"strukturag",
"libheif"
]
| Image::get_nclx_color_profile(), Image::get_color_profile_type(), Image::get_raw_color_profile(), and Image::set_raw_color_profile() are not declared inline, so if heif_cxx.h is included in two different modules, you can end up with link errors like:
```
duplicate symbol 'heif::Image::get_color_profile_type() const' in:
heifinput.cpp.o
heifoutput.cpp.o
```
This is a pretty serious build break, and this error just got incorporated into Homebrew's version of libheif, so everybody who builds any packages on Mac using Homebrew will find, as this auto-updates for them, to break their apps if they have more than one module including heif_cxx.h.
| Non-inline methods in heif_cxx.h causing trouble | https://api.github.com/repos/strukturag/libheif/issues/339/comments | 3 | 2020-09-25T06:05:04Z | 2020-09-25T15:37:52Z | https://github.com/strukturag/libheif/issues/339 | 708,667,765 | 339 |
[
"strukturag",
"libheif"
]
| I don't know why you closed this issue. ( https://github.com/strukturag/libheif/issues/228 )
The problem is not solved i just tested now.
heif_decode_image(handle, &img, heif_colorspace_undefined, heif_chroma_undefined, NULL);
The data is NULL from heif_image_get_plane_readonly(img, heif_channel_Y, &stride)
And it worked with version 1.6.2 (the version i am obliged to use )
| Cannot get data from image, crash ( heif_image_get_plane return NULL) | https://api.github.com/repos/strukturag/libheif/issues/336/comments | 8 | 2020-09-24T11:30:08Z | 2020-09-24T13:51:02Z | https://github.com/strukturag/libheif/issues/336 | 708,090,959 | 336 |
[
"strukturag",
"libheif"
]
| The decoder https://strukturag.github.io/libheif/ shows a corrupted image when the image width is odd. This is not due to libheif itself, as the image decodes fine even with v1.0.0. I guess it is a problem in the JS canvas drawing code.
See also #331 for a screenshot and the demo image.
| online JavaScript decoder shows corrupted image when image width is odd | https://api.github.com/repos/strukturag/libheif/issues/335/comments | 2 | 2020-09-21T15:06:29Z | 2020-11-03T07:24:11Z | https://github.com/strukturag/libheif/issues/335 | 705,685,036 | 335 |
[
"strukturag",
"libheif"
]
| Hi,
AFAIU libheif has to parse ISOBMFF files to do its job, I was wondering whether it would be worth splitting up the ISOBMFF parsing code into a library.
Ideally this would enable sharing the code with other projects like [libavif](https://github.com/AOMediaCodec/libavif) and possibly even [libexif](https://github.com/libexif/libexif) in case they decided to support extracting EXIF data from ISOBMFF files.
I know that this is easier said that done, but I wanted to at least ask if there is any interest.
FWIW there is already [libbmff](https://github.com/frejoel/bmffparse) by @frejoel, which is a small C shared library for parsing ISOBMFF but I don't know in what shape it is.
Feel free to close the issue if this is too far fetched. :sweat_smile:
Thanks,
Antonio | Factor out ISOBMFF parser | https://api.github.com/repos/strukturag/libheif/issues/333/comments | 3 | 2020-09-18T13:59:59Z | 2020-09-21T20:55:35Z | https://github.com/strukturag/libheif/issues/333 | 704,403,683 | 333 |
[
"strukturag",
"libheif"
]
| Hi,
looking for a way to encode AVIF to a byte slice (opposed to encoding to file and reading the file to have the image data) : is there anything already in place to use ?
Thanks
-Paul | Go: Support encoding to byte slice instead of encoding to a file | https://api.github.com/repos/strukturag/libheif/issues/332/comments | 1 | 2020-09-17T13:26:33Z | 2020-09-21T13:24:54Z | https://github.com/strukturag/libheif/issues/332 | 703,587,599 | 332 |
[
"strukturag",
"libheif"
]
| I discovered this issue while using ImageMagick to batch convert some images. Posting here because it seems that something in `libheif-1.8.0` is causing this issue.
The longer post with some other details can be found in this [ImageMagick issue I posted here][1] when I believed this was simply an ImageMagick issue. The process I am using with ImageMagick runs a simple Bash script to traverse a directory full of JPEG images to convert them to HEIC like this:
convert source.jpeg destination.heic
This worked fine for converting hundreds of images back in July 2020 when I was using an earlier version of ImageMagick with `libheif-1.7.0`.
But now — after doing a Homebrew package update that updated ImageMagick as well as `libheif-1.7.0` — it seems like a few out of every bunch of images I attempt to convert are unopenable and corrupt.
This happens to seemingly arbitrary images (not random images) but consistently. Meaning, if I give the script a pile of images to convert — such as `one.jpg`, `two.jpg`, `three.jpg`, etc… — and `two.jpg` is converted to `two.heic` which is corrupt, that image will always convert as a corrupt HEIC.
The same exact results — some images solid HEIC files and others unopenable/corrupt — can be seen if I use `heif-enc` to convert the images like this:
heif-enc source.jpeg -o destination.heic
Here are some test images I found (via the Wikimedia commons) that recreates the issue; `1280px-Test_(student_assessment).jpeg` always results in a corrupted and inoperable HEIC image:
- [1599px-Test_(student_assessment).jpeg][2]
- [Blue_Mountains_National_Park_(AU),_Three_Sisters_--_2019_--_1987-9.jpg][3]
[1]: https://github.com/ImageMagick/ImageMagick/issues/2585
[2]: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Test_%28student_assessment%29.jpeg/1599px-Test_%28student_assessment%29.jpeg
[3]: https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Blue_Mountains_National_Park_%28AU%29%2C_Three_Sisters_--_2019_--_1987-9.jpg/1156px-Blue_Mountains_National_Park_%28AU%29%2C_Three_Sisters_--_2019_--_1987-9.jpg | Seems like “libheif-1.8.0” is arbitrarily creating unopenable (corrupt?) HEIC files in macOS? | https://api.github.com/repos/strukturag/libheif/issues/331/comments | 15 | 2020-09-17T03:16:10Z | 2020-09-25T16:53:36Z | https://github.com/strukturag/libheif/issues/331 | 703,231,128 | 331 |
[
"strukturag",
"libheif"
]
| Can I use libheif javascript version on server side using node? I tried, it didn't work. | Use libheif javascript version on server side | https://api.github.com/repos/strukturag/libheif/issues/328/comments | 2 | 2020-09-14T21:29:29Z | 2020-09-22T02:21:06Z | https://github.com/strukturag/libheif/issues/328 | 701,438,145 | 328 |
[
"strukturag",
"libheif"
]
| Hello
error :
```heif_encoder_aom.cc: In function 'heif_error aom_encode_image(void*, const heif_image*, heif_image_input_class)':
heif_encoder_aom.cc:532:35: error: 'img_format' may be used uninitialized in this function [-Werror=maybe-uninitialized]
532 | img_format = (aom_img_fmt_t) (img_format | AOM_IMG_FMT_HIGHBITDEPTH);
| ^~~~~~~~~~
```
It's because of -Werror | error when compiling (Windows msys2+mingw-w64) | https://api.github.com/repos/strukturag/libheif/issues/324/comments | 1 | 2020-09-11T20:27:36Z | 2020-09-11T20:33:21Z | https://github.com/strukturag/libheif/issues/324 | 699,718,227 | 324 |
[
"strukturag",
"libheif"
]
| When I try to load an avif file, I have a big memory leak.
I use aom lib from av1 decoding.
I attach my code below
[avif.txt](https://github.com/strukturag/libheif/files/5200601/avif.txt)
| Memory leak with avif format | https://api.github.com/repos/strukturag/libheif/issues/317/comments | 6 | 2020-09-10T09:33:07Z | 2020-09-11T12:05:58Z | https://github.com/strukturag/libheif/issues/317 | 697,676,838 | 317 |
[
"strukturag",
"libheif"
]
| Please check these two images:
Oringinal: https://www.websitepolicies.com/uploads/j/i/j/a/kog3telytsh1ifkxvg4v.png
AVIF: https://websitepolicies.gumlet.io/uploads/j/i/j/a/kog3telytsh1ifkxvg4v.png?format=avif
The AVIF image has some color distortion on black texts. | AVIF image creates some weird artefacts on text | https://api.github.com/repos/strukturag/libheif/issues/315/comments | 14 | 2020-09-10T06:03:57Z | 2020-10-01T04:49:02Z | https://github.com/strukturag/libheif/issues/315 | 697,479,062 | 315 |
[
"strukturag",
"libheif"
]
| example/encoder_png.cc doesn't have a stdlib.h header file which can lead to make error.

| example/encoder_png.cc doesn't have a stdlib.h header file | https://api.github.com/repos/strukturag/libheif/issues/314/comments | 1 | 2020-09-10T05:37:51Z | 2020-09-11T12:28:58Z | https://github.com/strukturag/libheif/issues/314 | 697,465,407 | 314 |
[
"strukturag",
"libheif"
]
| I have sRGB image in JPG format and identical copy as PNG.
Encoding JPG and PNG via heif-enc gives different results.
YUV values from JPG are used directly. When input is PNG, RGB->YUV conversion in libheif is performed.
The difference is not big, but noticeable sometimes.
I suspect the difference could be a numerical error caused maybe conversions from float to int without rounding.
I wish to look at the conversion math closer with goal to reach more accurate results.
| Improve RGB->YUV conversion | https://api.github.com/repos/strukturag/libheif/issues/313/comments | 16 | 2020-09-09T20:02:34Z | 2020-09-13T15:16:59Z | https://github.com/strukturag/libheif/issues/313 | 697,119,924 | 313 |
[
"strukturag",
"libheif"
]
| https://www.unnatisilks.com/pub/static/version1598010421/frontend/Mgs/unnati/en_US/MGS_Mpanel/images/blank.png
If this image is converted to AVIF using rav1e encoder, it can't be opened in Chrome 85. | PNG converted to AVIF can't be opened in chrome | https://api.github.com/repos/strukturag/libheif/issues/311/comments | 5 | 2020-09-08T11:14:17Z | 2020-10-01T04:48:09Z | https://github.com/strukturag/libheif/issues/311 | 695,781,295 | 311 |
[
"strukturag",
"libheif"
]
| For now: a Adobe RGB & P3 Jpeg will be convert to sRGB.
Before
<img width="401" alt="Xnip2020-09-08_00-15-40" src="https://user-images.githubusercontent.com/16457655/92405583-847e8b80-f168-11ea-9659-1224f604ed9a.png">
After
<img width="395" alt="Xnip2020-09-08_00-16-03" src="https://user-images.githubusercontent.com/16457655/92405599-89433f80-f168-11ea-901d-ce526e458c89.png">
Shall we keep them? | Adobe RGB & Display P3 Support | https://api.github.com/repos/strukturag/libheif/issues/310/comments | 10 | 2020-09-07T16:20:10Z | 2021-10-05T16:11:50Z | https://github.com/strukturag/libheif/issues/310 | 695,254,955 | 310 |
[
"strukturag",
"libheif"
]
| Hello, thank you for this nice library.
The [`cmake/modules`](https://github.com/strukturag/libheif/tree/master/cmake/modules) directory was added in https://github.com/strukturag/libheif/pull/210, but is currently missing from the v1.8.0 tarball. As a result, it's currently giving this CMake error while configuring libheif (tested on MinGW-w64):
```
CMake Error at CMakeLists.txt:57 (find_package):
By not providing "FindLibde265.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Libde265",
but CMake did not find one.
Could not find a package configuration file provided by "Libde265" with any
of the following names:
Libde265Config.cmake
libde265-config.cmake
Add the installation prefix of "Libde265" to CMAKE_PREFIX_PATH or set
"Libde265_DIR" to a directory containing one of the above files. If
"Libde265" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
```
Building from git works without any problems. | cmake/modules directory missing from tarball | https://api.github.com/repos/strukturag/libheif/issues/307/comments | 1 | 2020-09-05T12:04:56Z | 2020-09-24T10:01:54Z | https://github.com/strukturag/libheif/issues/307 | 694,072,002 | 307 |
[
"strukturag",
"libheif"
]
| Hi,
while building `libheif 1.8.0` on _SmartOS_, I've come across some problems, like uninitialized variables and improper casts.
See following patches that I recently incorporarated into pkgsrc:
```
[builder@sosbuild02 ~/pkgsrc/graphics/libheif/patches]$ cat patch-examples_heif__convert.cc
$NetBSD: patch-examples_heif__convert.cc,v 1.1 2020/09/03 19:07:19 otis Exp $
Include alloca.h on SunOS
--- examples/heif_convert.cc.orig 2020-08-13 16:57:45.000000000 +0000
+++ examples/heif_convert.cc
@@ -35,6 +35,10 @@
#endif
+#if defined(sun) || defined(__sun)
+#include <alloca.h>
+#endif
+
#include <fstream>
#include <iostream>
#include <sstream>
```
```
[builder@sosbuild02 ~/pkgsrc/graphics/libheif/patches]$ cat patch-examples_heif__enc.cc
$NetBSD: patch-examples_heif__enc.cc,v 1.1 2020/09/03 19:07:19 otis Exp $
Excplicitly cast types to make ISO C++ happy
--- examples/heif_enc.cc.orig 2020-08-14 15:28:08.000000000 +0000
+++ examples/heif_enc.cc
@@ -71,21 +71,21 @@ int nclx_transfer_characteristic = 2;
int nclx_full_range = true;
static struct option long_options[] = {
- {"help", no_argument, 0, 'h'},
- {"quality", required_argument, 0, 'q'},
- {"output", required_argument, 0, 'o'},
- {"lossless", no_argument, 0, 'L'},
- {"thumb", required_argument, 0, 't'},
- {"verbose", no_argument, 0, 'v'},
- {"params", no_argument, 0, 'P'},
- {"no-alpha", no_argument, &master_alpha, 0},
- {"no-thumb-alpha", no_argument, &thumb_alpha, 0},
- {"bit-depth", required_argument, 0, 'b'},
- {"avif", no_argument, 0, 'A'},
- {"matrix_coefficients", required_argument, &nclx_matrix_coefficients, 0},
- {"colour_primaries", required_argument, &nclx_colour_primaries, 0},
- {"transfer_characteristic", required_argument, &nclx_transfer_characteristic, 0},
- {"full_range_flag", required_argument, &nclx_full_range, 0},
+ {(char * const)"help", no_argument, 0, 'h'},
+ {(char * const)"quality", required_argument, 0, 'q'},
+ {(char * const)"output", required_argument, 0, 'o'},
+ {(char * const)"lossless", no_argument, 0, 'L'},
+ {(char * const)"thumb", required_argument, 0, 't'},
+ {(char * const)"verbose", no_argument, 0, 'v'},
+ {(char * const)"params", no_argument, 0, 'P'},
+ {(char * const)"no-alpha", no_argument, &master_alpha, 0},
+ {(char * const)"no-thumb-alpha", no_argument, &thumb_alpha, 0},
+ {(char * const)"bit-depth", required_argument, 0, 'b'},
+ {(char * const)"avif", no_argument, 0, 'A'},
+ {(char * const)"matrix_coefficients", required_argument, &nclx_matrix_coefficients, 0},
+ {(char * const)"colour_primaries", required_argument, &nclx_colour_primaries, 0},
+ {(char * const)"transfer_characteristic", required_argument, &nclx_transfer_characteristic, 0},
+ {(char * const)"full_range_flag", required_argument, &nclx_full_range, 0},
{0, 0, 0, 0}
};```
```[builder@sosbuild02 ~/pkgsrc/graphics/libheif/patches]$ cat patch-examples_heif__info.cc
$NetBSD: patch-examples_heif__info.cc,v 1.1 2020/09/03 19:07:19 otis Exp $
Excplicitly cast types to make ISO C++ happy
--- examples/heif_info.cc.orig 2020-08-13 16:57:45.000000000 +0000
+++ examples/heif_info.cc
@@ -38,6 +38,10 @@
#define STDOUT_FILENO 1
#endif
+#if defined(sun) || defined(__sun)
+#include <alloca.h>
+#endif
+
#include <libheif/heif.h>
#include <fstream>
@@ -65,8 +69,8 @@ info -d // dump
static struct option long_options[] = {
//{"write-raw", required_argument, 0, 'w' },
//{"output", required_argument, 0, 'o' },
- {"dump-boxes", no_argument, 0, 'd'},
- {"help", no_argument, 0, 'h'},
+ {(char * const)"dump-boxes", no_argument, 0, 'd'},
+ {(char * const)"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
```
```
[builder@sosbuild02 ~/pkgsrc/graphics/libheif/patches]$ cat patch-examples_heif__test.cc
$NetBSD: patch-examples_heif__test.cc,v 1.1 2020/09/03 19:07:19 otis Exp $
Excplicitly cast types to make ISO C++ happy
--- examples/heif_test.cc.orig 2020-08-13 16:57:45.000000000 +0000
+++ examples/heif_test.cc
@@ -50,8 +50,8 @@
static struct option long_options[] = {
//{"write-raw", required_argument, 0, 'w' },
//{"output", required_argument, 0, 'o' },
- {"decode-img", required_argument, 0, 'd'},
- {"metadata", required_argument, 0, 'm'},
+ {(char * const)"decode-img", required_argument, 0, 'd'},
+ {(char * const)"metadata", required_argument, 0, 'm'},
{0, 0, 0, 0}
};
```
```
[builder@sosbuild02 ~/pkgsrc/graphics/libheif/patches]$ cat patch-libheif_heif__encoder__aom.cc
$NetBSD: patch-libheif_heif__encoder__aom.cc,v 1.1 2020/09/03 19:07:19 otis Exp $
Initialize variable to silence -Werror
--- libheif/heif_encoder_aom.cc.orig 2020-08-26 13:47:18.000000000 +0000
+++ libheif/heif_encoder_aom.cc
@@ -510,7 +510,7 @@ struct heif_error aom_encode_image(void*
aom_image_t input_image;
- aom_img_fmt_t img_format;
+ aom_img_fmt_t img_format = AOM_IMG_FMT_NONE;
switch (chroma) {
case heif_chroma_420:
```
You might want to review them and incorporated them, eventually.
Hope this helps.
Thanks! 👍
| Building libheif 1.8.0 on platforms with gcc 7.5 (SmartOS, for example) | https://api.github.com/repos/strukturag/libheif/issues/306/comments | 1 | 2020-09-03T20:05:10Z | 2020-09-07T14:57:28Z | https://github.com/strukturag/libheif/issues/306 | 692,285,468 | 306 |
[
"strukturag",
"libheif"
]
| Hey, I was looking into updating Krita's heif plugin with all the new goodness, and while I can access most functionality, the ability to access the color profile information is missing.
As an aside, does anyone have any idea when to interpret a 10/12 bit image as HDR? For us it makes the difference between whether we should load it as an 16 integer image or a 16 floating point one, but right now the only indication I can find is the presence of maxfall and friends. | heif_cxx.h is missing entries for color profile. | https://api.github.com/repos/strukturag/libheif/issues/305/comments | 6 | 2020-09-03T12:11:52Z | 2020-09-11T11:55:04Z | https://github.com/strukturag/libheif/issues/305 | 691,916,158 | 305 |
[
"strukturag",
"libheif"
]
| Hi,
Thanks a lot for putting this library together.
I'm using `heif-enc` tool to convert JPEGs/PNGs to AVIF and noticed that colors are different on source and result images.
```
dooman@lapata:~$ heif-enc --help
heif-enc libheif version: 1.8.0
----------------------------------------
Usage: heif-enc [options] image.jpeg ...
...
dooman@lapata:~$ heif-enc ./test.jpeg -A -o ./test.avif
```
Example images:


If you open source and result images in 2 tabs of the browser then you could notice that AVIF images are lighter.
Web browser:
Google Chrome | 85.0.4183.83 (Official Build) (64-bit)
-- | --
Revision | 94abc2237ae0c9a4cb5f035431c8adfb94324633-refs/branch-heads/4183@{#1658}
OS | Linux
JavaScript | V8 8.5.210.20
Libheif 1.8.0 with libaom-2.0.0 | AVIF image is brighter than original | https://api.github.com/repos/strukturag/libheif/issues/304/comments | 8 | 2020-08-31T12:27:14Z | 2023-09-20T14:53:24Z | https://github.com/strukturag/libheif/issues/304 | 689,168,049 | 304 |
[
"strukturag",
"libheif"
]
| Hi there,
I'm using libheif through ImageMagick. I've updated libheif to the latest release (1.8.0) and noticed an issue when converting PNG to AVIF.
I attached an example of original image and using libheif with aom and rav1e.
## Original

## AOM (screenshot from Chrome 85)
<img width="554" alt="aom" src="https://user-images.githubusercontent.com/124110/91506182-d1ff2b00-e914-11ea-9daa-6ea9cf37ae08.png">
## RAV1E (screenshot from Chrome 85)
<img width="554" alt="rav1e" src="https://user-images.githubusercontent.com/124110/91506186-d62b4880-e914-11ea-9157-4be3583c3b78.png">
With version 1.7.0 file sizes were bigger, but there was no visual artifacts as an example above.
| AVIF encoding of semitransparent pixels degraded in 1.8.0 | https://api.github.com/repos/strukturag/libheif/issues/298/comments | 6 | 2020-08-27T23:58:57Z | 2020-08-30T13:01:44Z | https://github.com/strukturag/libheif/issues/298 | 687,614,910 | 298 |
[
"strukturag",
"libheif"
]
| libde265 initializer is protected with static mutex:
`static std::mutex de265_init_mutex;`
libheif plugin initializer is also static:
`static class Register_Default_Plugins
{
....
} dummy;
`
This may result in wrong order of calls: when dummy's constructor is called, de265_init_mutex is not yet initialized.
I was **immediately** hit by this when trying to understand libheif API (by running heif-convert under debugger). I'm using static libraries for both libheif and libde265.
With dynamic libraries this may be a non issue because of dynamic libraries initialization order (libde265.so probably ininitalized before libheif.so because libheif depends on libde265).
Possible solution: implement explicit heif_init_plugins() call that will call plugin registration after libde265 initialization (e.g. from main()) | libheif+libde265 static variables initialization order problem | https://api.github.com/repos/strukturag/libheif/issues/297/comments | 1 | 2020-08-27T05:26:26Z | 2020-08-27T10:56:07Z | https://github.com/strukturag/libheif/issues/297 | 686,949,946 | 297 |
[
"strukturag",
"libheif"
]
| I have a sample AVIF file of page 1 of the U.S. Constitution stored on the Bitcoin blockchain here:
https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f
The file is viewable with avif.js:
https://kagami.github.io/avif.js/?src=https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f
It would be nice if libheif could also render the same file.
PS: A query param to accept a file location for your web-based image viewer would also be a cool addition. | Online demo can't decode my AVIF sample file | https://api.github.com/repos/strukturag/libheif/issues/296/comments | 6 | 2020-08-24T20:04:00Z | 2021-11-04T22:28:57Z | https://github.com/strukturag/libheif/issues/296 | 684,930,710 | 296 |
[
"strukturag",
"libheif"
]
| There are illegal memory accesses coming from x265. E.g.:
https://github.com/strukturag/libheif/runs/1022460208?check_suite_focus=true
These seem to get less with rounding to larger integer multiples. However, they do not seem to get away completely, even when rounding image resolution to steps of 128 pixels.
| x265 fails fuzzer tests | https://api.github.com/repos/strukturag/libheif/issues/295/comments | 1 | 2020-08-24T16:22:04Z | 2020-08-26T14:23:02Z | https://github.com/strukturag/libheif/issues/295 | 684,799,337 | 295 |
[
"strukturag",
"libheif"
]
| Hello,
I have a 8bit PNG file with transparency. Dimensions are 2001x1984

I encode the PNG to HEIC and to AVIF:
```
heif-enc -o failure.heic 8alpha.png
heif-enc -A -o ok.avif 8alpha.png
```
The ok.avif opens fine, but failure.heic returns
`Could not decode image: 0: Unsupported feature: Unsupported color conversion`
I think the problem is related to the image dimensions somehow. | Unable to decode some heif-enc encoded HEIC files | https://api.github.com/repos/strukturag/libheif/issues/291/comments | 5 | 2020-08-21T12:41:09Z | 2020-09-07T07:47:41Z | https://github.com/strukturag/libheif/issues/291 | 683,533,253 | 291 |
[
"strukturag",
"libheif"
]
| I am trying to build with `rav1e` support with `./configure --enable-local-rav1e`. However, I am getting following error.
```
heif_encoder_rav1e.cc:40:10: fatal error: rav1e/rav1e.h: No such file or directory
3565 #include "rav1e/rav1e.h"
```
Can you let me know if there is any issue? | Building with rav1e throws error | https://api.github.com/repos/strukturag/libheif/issues/290/comments | 17 | 2020-08-16T07:44:25Z | 2020-09-11T12:29:43Z | https://github.com/strukturag/libheif/issues/290 | 679,708,714 | 290 |
[
"strukturag",
"libheif"
]
| Hello,
https://github.com/strukturag/libheif/blob/master/go/heif/heif_test.go file is not included in release tarballs, making it impossible to run the test by default (see https://github.com/gentoo/gentoo/pull/17122 for reference). Could you include that file as part of future releases?
Thank you,
Jakov | heif_test.go not included in the tarball | https://api.github.com/repos/strukturag/libheif/issues/289/comments | 2 | 2020-08-15T09:14:34Z | 2020-08-24T18:07:08Z | https://github.com/strukturag/libheif/issues/289 | 679,531,720 | 289 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.