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"
]
| Hi,
I have a dual CPU Xeon E5530 based Dell workstation (aka 2 sockets, 8 cores, 16 logical processors) on Win10.
All sockets, cores, and logical processors are visible, and all 16 logical processors can be used for video encoding by apps such as Handbrake.
Running a HEIF-ENC test conversion of 500,000+ JPG images, Task Manager indicates only the 1st 8 logical processors are being used (at ~100%) - the last 8 being completely idle). Each CPU socket is a 4 core / 8 logical processor unit.
Is Heif-enc only 'binding' to the 1st physical CPU?
Can this be altered to use all available CPU's ?
Many thanks
| Heif-enc 1.12.0 not using all physical processors (sockets), cores, logical processors | https://api.github.com/repos/strukturag/libheif/issues/602/comments | 7 | 2022-02-18T12:43:52Z | 2022-02-20T15:56:52Z | https://github.com/strukturag/libheif/issues/602 | 1,142,992,583 | 602 |
[
"strukturag",
"libheif"
]
| Hello,
I added a functionality to our non open source application to convert .heic to jpg using libheif. I later fell into the rabbit hole that is the HEVC patent topic and I'm having a very hard time finding information so I was hoping maybe you can shed some light. I only need the decoder (no encoder), as far as I understand I don't need the MulticoreWare encoder license but I can't figure if I still need something to be in compliance with patents, can you give me some information or pointing to the right direction?
Thanks | libde265 decode and patents | https://api.github.com/repos/strukturag/libheif/issues/601/comments | 4 | 2022-02-03T14:25:41Z | 2022-02-08T14:32:40Z | https://github.com/strukturag/libheif/issues/601 | 1,123,150,201 | 601 |
[
"strukturag",
"libheif"
]
| I was trying out the demo website, but the tab keeps crashing with Out of memory error
file - https://drive.google.com/file/d/1qSGzuBe5vN6RW8FcfkKw1wzhI1YFywxh/view?usp=sharing
When I connect my device with remote debugging to my PC, chrome pauses before the crash and shows the stack trace (added below)
The error happens consistently every time.
Thanks in advance !!
device and browser Info
---
Android 11
Ram - 6GB
Chrome 97.0.4692.98
stack trace
---
```
fromWireType (libheif.js:formatted:6482)
simpleReadValueFromPointer (libheif.js:formatted:5263)
__emval_take_value (libheif.js:formatted:6661)
Cl (libheif.js:formatted:107843)
fl (libheif.js:formatted:107495)
gl (libheif.js:formatted:107531)
WM (libheif.js:formatted:122173)
dynCall_iiiii_7 (VM23:4)
heif_js_decode_image (VM148:10)
(anonymous) (libheif.js:formatted:122932)
(anonymous) (libheif.js:formatted:122943)
CanvasDrawer.draw ((index):132)
HeifDemo._showImage ((index):271)
HeifDemo.loadBuffer ((index):247)
(anonymous) ((index):340)
setTimeout (async)
(anonymous) ((index):338)
load (async)
(anonymous) ((index):334)
```
screenshot
---
<img width="1440" alt="image" src="https://user-images.githubusercontent.com/46242073/151960485-4bad500c-0039-4bfe-b2cc-90392b2e6b57.png">
| Out of memory crash | https://api.github.com/repos/strukturag/libheif/issues/597/comments | 0 | 2022-02-01T11:30:20Z | 2022-02-01T11:30:20Z | https://github.com/strukturag/libheif/issues/597 | 1,120,551,056 | 597 |
[
"strukturag",
"libheif"
]
| AOM version 3.0.0 added a key=value API to configure the decoder and encoder parameters.
`aom_codec_err_t aom_codec_set_option(aom_codec_ctx_t *ctx, const char *name, const char* value);`
This would allow consumers to pass parameters to the encoder without needing to extend the libheif AOM wrapper to support each new parameter. | Add support for the AOM encoder key=value API | https://api.github.com/repos/strukturag/libheif/issues/596/comments | 0 | 2022-02-01T01:08:17Z | 2022-02-19T18:19:48Z | https://github.com/strukturag/libheif/issues/596 | 1,120,119,960 | 596 |
[
"strukturag",
"libheif"
]
| I have a HEIC file that renders properly on MacOS and with libheif.so.1.11.0 but it stopped rendering when I updated aom, de265, x265, and heif.
It renders with libaom.3.0.0, libde265.so.0.1.1, libx265.so.200, and libheif.so.1.11.0.
It fails to render with libaom.3.2.0, libde265.so.0.1.1, libx265.so.201, and libheif.so.1.12.0.
For my use, the error comes from "heif_context_read_from_memory_without_copy" with error.code 2: Could not read HEIF/AVIF file: Invalid input: No 'meta' box
I see the same error when using heif-convert:
```
$ heif-convert fakeid.heic fakeid.jpg
Could not read HEIF/AVIF file: Invalid input: No 'meta' box
```
heif-info -d fakeid.heic says:
```
$ heif-info -d fakeid.heic
MIME type: image/heic
main brand: heic
compatible brands: heic, mif1
Box: ftyp -----
size: 24 (header size: 8)
major brand: heic
minor version: 0
compatible brands: heic,mif1
```
(That's all it shows.)
My own heic parser (it just checks structure, not rendering) correctly identifies all of the components and it correctly finds the meta box.
```
<summary field='Structure Summary'>
<summary field='meta' offset='0x1c' size='1090' value=''/>
<summary field='meta:hdlr' offset='0x2c' size='26' value=''/>
<summary field='meta:dinf' offset='0x4e' size='28' value=''/>
<summary field='meta:dinf:dref' offset='0x56' size='20' value=''/>
<summary field='meta:pitm' offset='0x72' size='6' value='PrimaryID=1'/>
<summary field='meta:iinf' offset='0x86' size='89' value=''/>
<summary field='meta:iinf:infe' offset='0x86' size='0' value=''/>
<summary field='meta:iinf:infe:hvc1' offset='0x86' size='21' value='ID=1, Image=0, 436x748 at 0x0'/>
<summary field='meta:iinf:infe:Exif' offset='0x9b' size='21' value='ID=2'/>
<summary field='meta:iinf:infe:mime' offset='0xb0' size='21' value='ID=3'/>
<summary field='meta:iref' offset='0xe1' size='32' value=''/>
<summary field='meta:iref:cdsc' offset='0xed' size='6' value=''/>
<summary field='meta:iref:cdsc' offset='0xfb' size='6' value=''/>
<summary field='meta:iprp' offset='0x109' size='791' value=''/>
<summary field='meta:iprp:ipco' offset='0x111' size='758' value=''/>
<summary field='meta:iprp:ipco:colr' offset='0x119' size='552' value=''/>
<summary field='meta:iprp:ipco:hvcC' offset='0x349' size='105' value=''/>
<summary field='meta:iprp:ipco:ispe' offset='0x3ba' size='12' value='436x748 at 0x0'/>
<summary field='meta:iprp:ipco:clap' offset='0x3ce' size='32' value='435x747 at 0x0'/>
<summary field='meta:iprp:ipco:irot' offset='0x3f6' size='1' value=''/>
<summary field='meta:iprp:ipco:pixi' offset='0x3ff' size='8' value=''/>
<summary field='meta:iprp:ipma' offset='0x40f' size='17' value=''/>
<summary field='meta:iprp:ipma:data' offset='0x417' size='0' value='ID=1, 436x748 at 0x0, hvcC=2, colr=1, irot=5, clap=4'/>
<summary field='meta:iloc' offset='0x428' size='50' value=''/>
<summary field='meta:iloc:data' value='ID=1, Image=0, 436x748 at 0x0, hvcC=2, colr=1, irot=5, clap=4'/>
<summary field='meta:iloc:data' value='ID=2'/>
<summary field='meta:iloc:data' value='ID=3'/>
<summary field='mdat' offset='0x45e' size='49809' value=''/>
</summary>
```
I'd rather not post the picture to this public forum since it is a picture of an ID card. (Granted, it's a bad fake id that is likely from a catfish scam, it's still "an id".) | Invalid input: No 'meta' box | https://api.github.com/repos/strukturag/libheif/issues/595/comments | 6 | 2022-01-27T23:44:53Z | 2022-08-30T21:08:18Z | https://github.com/strukturag/libheif/issues/595 | 1,116,850,426 | 595 |
[
"strukturag",
"libheif"
]
| I've got a HEIC image that will not load using LibHeifSharp. However, if I bind to libheif directly, i can get it to work.
Looking into the source, it appears that LibHeifSharp bindings only use the heif_context_read_from_reader method to load the content. If i use heif_context_read_from_file or heif_context_read_from_memory, it works just fine.
Specifically, when using heif_context_read_from_reader, the library aborts due to an assertion failure inside read_data of box.cc
I assume this is a bug within libheif and not a bug in LibHeifSharp. Let me know if you'd like a sample HEIC image. | heif_context_read_from_reader bug? | https://api.github.com/repos/strukturag/libheif/issues/593/comments | 4 | 2022-01-25T22:37:48Z | 2023-06-10T09:28:44Z | https://github.com/strukturag/libheif/issues/593 | 1,114,431,377 | 593 |
[
"strukturag",
"libheif"
]
| I have searched but have not found anything. Concrete I am searching for an example to print just all metadata of a file on the console.
The problem I have seen is that in the header file all API request is needing a metadata ID. But I have nothing found to get that ID.
How can I access e.g. the exif data ?
Thank you in advance.
Clemens | Example for metadata in C | https://api.github.com/repos/strukturag/libheif/issues/592/comments | 4 | 2022-01-24T12:04:24Z | 2022-01-30T09:30:40Z | https://github.com/strukturag/libheif/issues/592 | 1,112,557,518 | 592 |
[
"strukturag",
"libheif"
]
| I keep hearing conflicting information about the patents involved with x265 HEVC encoding and I'm trying to get a straight answer.
On VideoLAN's [website](https://www.videolan.org/developers/x265.html), they state that:
> x265 is a free software library and application for encoding video streams into the H.265/MPEG-H HEVC compression format, and is released under the terms of the GNU GPL.
AFAIK the GPLv2 license basically states that, if you distribute the software in a binary or source format, you need to include a copy of the license with the distribution so other people can view the source code.
I would to use libx265 (via libheif) to produce HEIC (HEVC-encoded HEIF) files on my server.
Users will first upload photos in a variety of different source formats (JPEG, PNG, HEIC, TIFF, etc.),
and the server will decode these into a bitmap and then produce a HEIC image from that, storing it in S3.
My understanding is that the GPLv2 license would not pose an issue here because I'm not distributing the software to anyone, just using it to encode the image files.
That said, I understand that patents also potentially pose an issue here. Per Access Advance's [faq](https://accessadvance.com/faq/) and [topic-what-do-we-license](https://accessadvance.com/topic-what-do-we-license/):
> You most likely need a license if you sell any products that have HEVC/H.265 encoding and/or decoding capability/functionality
> Parties that (a) provide End Users with access to HEVC encoders and/or decoders through the internet or another public or private network or (b) process content at the End User’s request using HEVC encoders and/or decoders where the output is returned to the End User
If I want to HEIC-encode images uploaded to my social media app from their source format, am I correct in assuming that I would need a license for that? | libheif / libx265 encoder GPL license and patents? | https://api.github.com/repos/strukturag/libheif/issues/591/comments | 3 | 2022-01-24T04:45:42Z | 2022-01-24T21:22:37Z | https://github.com/strukturag/libheif/issues/591 | 1,112,166,648 | 591 |
[
"strukturag",
"libheif"
]
| Hello libheif team,
I have found an issue in libheif that severely impacts the availability and potentially the integrity (depending on context) of software systems that utilize the library. As the issue triggers a stack overflow on some systems, code execution could be possible.
Issue has been tested with the "heif-convert" sample program. Other programs such as Google Photos in Android enter into an infinite loop.
**ISSUE:**
Specially crafted .heic files can trigger a stack-based overflow at get_id_of_non_virtual_child_image() in heif_context.cc.
**PoC:**
1. [https://github.com/CarlosAndresRamirez/PoCs/blob/main/libheif-PoC-Stack-Overflow-02.heic](https://github.com/CarlosAndresRamirez/PoCs/blob/main/libheif-PoC-Stack-Overflow-02.heic)
2. [https://github.com/CarlosAndresRamirez/PoCs/blob/main/libheif-PoC-Stack-Overflow.heic](https://github.com/CarlosAndresRamirez/PoCs/blob/main/libheif-PoC-Stack-Overflow.heic)
> ./heif-convert libheif-PoC-Stack-Overflow.heic output.png
File contains 1 images
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2081262==ERROR: AddressSanitizer: stack-overflow on address 0x7fffff7feff8 (pc 0x0000004c2fb5 bp 0x7ffff5690000 sp 0x7fffff7ff000 T0)
...
SUMMARY: AddressSanitizer: stack-overflow
==2081262==ABORTING
>
Thanks,
Carlos Andres Ramirez
Security Engineer | Stack Overflow in libheif | https://api.github.com/repos/strukturag/libheif/issues/590/comments | 0 | 2022-01-23T15:18:36Z | 2023-04-14T18:20:05Z | https://github.com/strukturag/libheif/issues/590 | 1,111,899,530 | 590 |
[
"strukturag",
"libheif"
]
| I just want to let you know that I have now release the first version of our lib for JavaFX under https://github.com/lanthale/libheiffx
If you don't mind to list this as an addition to the other language bindinds already existing.
But for now I had to extend the C API with two method calls because one C feature was not working with the actual JDK automatic C calling function.
Thank you in advance.
Clemens | Javafx language binding - inital release | https://api.github.com/repos/strukturag/libheif/issues/589/comments | 0 | 2022-01-21T21:03:35Z | 2022-01-21T21:03:35Z | https://github.com/strukturag/libheif/issues/589 | 1,110,940,032 | 589 |
[
"strukturag",
"libheif"
]
| Hi,
Have anyone imported libhevc into libheif? I try to add libhevc plugin, but can't decode success.
And I write the hevc data which libheif extracted from .heic file to local file. Both libde265 and libhevc can't decode it.
Using nokia/heif extract hevc data from .heic can be decoded success. The difference between nokia/heif's hevc data and libheif's hevc data just have 16 bytes differ. | Import libhevc | https://api.github.com/repos/strukturag/libheif/issues/588/comments | 0 | 2022-01-21T02:16:34Z | 2022-01-21T02:16:34Z | https://github.com/strukturag/libheif/issues/588 | 1,109,974,991 | 588 |
[
"strukturag",
"libheif"
]
| As a follow up to #586 (smooth chroma upsampling), a second (bigger) step would be to add support for "sharp yuv", a slower rgb->yuv420 conversion technique that minimizes arifacts caused by chroma subsampling. The algorithm assumes that the image is decoded with bilinear upsampling.
It was first implemented in webp, see an intro/example here https://www.ctrl.blog/entry/webp-sharp-yuv.html
libwebp code is here: https://github.com/webmproject/libwebp/blob/36a6eea3bc2871c7f0166193a6fa42241af4a464/src/enc/picture_csp_enc.c#L447
Would you consider adding it as an optional subsampling method to libheif? If so, would you rather have it be reimplemented in libheif, or use an implementation from an external library, if available? (we are considering adding it to libyuv or possibly creating a separate library). | Add support for sharp yuv | https://api.github.com/repos/strukturag/libheif/issues/587/comments | 4 | 2022-01-19T15:28:08Z | 2023-05-31T15:14:36Z | https://github.com/strukturag/libheif/issues/587 | 1,108,239,872 | 587 |
[
"strukturag",
"libheif"
]
| Libheif currently only supports nearest neighbor chroma upsampling, which often leads to extra artifacts when decoding YUV420 images.
Most codecs support a bilinear chroma upsampling with weights 9:3:3:1
E.g. if you have the following Luma and Chroma samples (with centered chroma samples, as per issue #521):
L L L L
C1 C2
L L* L L
L L L L
C3 C4
L L L L
then the value of chroma at the position marked with * would be:
C = (9 * C1 + 3 * C2 + 3 * C3 + C4)/16
See also the implementation in libavif: https://github.com/AOMediaCodec/libavif/blob/ded15fb7b41b0513e138ba457034a2fb91c1f2c9/src/reformat.c#L496
[Here is an example](https://github.com/strukturag/libheif/files/7889137/example_upsampling.zip) (artificial) avif image, decoded with libheif (nearest neighbor) and with libavif (smooth upsampling). The difference is very obvious when zooming in.

| Add support for smooth chroma upsampling | https://api.github.com/repos/strukturag/libheif/issues/586/comments | 2 | 2022-01-18T12:53:04Z | 2022-01-20T13:20:53Z | https://github.com/strukturag/libheif/issues/586 | 1,106,874,811 | 586 |
[
"strukturag",
"libheif"
]
| I am working to create a language binding for Javafx. The problem I am facing is that the important structs heif_image_handle und heif_image are not in C form. That means I cannot access it.
It would be helpful if there is a C method to return a struct of that type. Because than I can reserve Memory with exactly that structure return from the method and all is fine.
I tried to get the information from api_structs.h but I could not find out how image_handle and image is structured without CPP data formats. | libheif javafx language binding - structs request | https://api.github.com/repos/strukturag/libheif/issues/585/comments | 1 | 2022-01-16T10:45:18Z | 2022-01-16T19:14:34Z | https://github.com/strukturag/libheif/issues/585 | 1,105,017,169 | 585 |
[
"strukturag",
"libheif"
]
| I converted some HEIF to jpg but it seems using gwenview that there is something wrong with orientation. :-( | heif-convert: orientation wront / does not rotate the pictures? | https://api.github.com/repos/strukturag/libheif/issues/584/comments | 5 | 2022-01-03T20:49:54Z | 2022-10-24T20:10:33Z | https://github.com/strukturag/libheif/issues/584 | 1,092,809,142 | 584 |
[
"strukturag",
"libheif"
]
| since libheif is LGPL, would it be nice to use non-GPL heic encoder? effectively combining x265 and libheif make it GPL
alternative:
[kvazaar](https://github.com/ultravideo/kvazaar): BSD
[svt-hevc](https://github.com/OpenVisualCloud/SVT-HEVC) : BSD but have patent clause
what's the obstacle supporting one of those, legal or technical-wise? | alternative h265 encoder? | https://api.github.com/repos/strukturag/libheif/issues/582/comments | 4 | 2022-01-03T01:50:48Z | 2023-05-30T10:56:03Z | https://github.com/strukturag/libheif/issues/582 | 1,092,167,315 | 582 |
[
"strukturag",
"libheif"
]
| I'm encountering the issue where libheif.js is catching unrelated exceptions / rejections as related to this issue https://github.com/emscripten-core/emscripten/issues/7855
it makes debugging applications using libheif very difficult. Can a work around to this issue be added similar to: https://github.com/OpenSLX/picotcp.js/commit/a68205e06ec8686102e3e7cf61da3419b972103b | libheif catching unrelated exceptions | https://api.github.com/repos/strukturag/libheif/issues/581/comments | 0 | 2021-12-30T19:12:18Z | 2021-12-30T19:12:18Z | https://github.com/strukturag/libheif/issues/581 | 1,091,265,020 | 581 |
[
"strukturag",
"libheif"
]
| Hello,
`fox.profile2.12bpc.yuv444.monochrome.odd-width.odd-height.avif` testfile
[source.zip](https://github.com/strukturag/libheif/files/7740656/source.zip)
gets decoded differently via libheif compared to the output of libavif.
`heif-convert fox.profile2.12bpc.yuv444.monochrome.odd-width.odd-height.avif libheif.png`

`avifdec fox.profile2.12bpc.yuv444.monochrome.odd-width.odd-height.avif libavif.png`

There is visible difference between the decoded images, libavif version has higher contrast.
I think libheif did not recalculate the limited range to the full range.
| gray-scale AVIF with limited range gets decoded differently via libheif vs libavif | https://api.github.com/repos/strukturag/libheif/issues/580/comments | 0 | 2021-12-19T10:54:16Z | 2021-12-19T10:54:16Z | https://github.com/strukturag/libheif/issues/580 | 1,084,069,355 | 580 |
[
"strukturag",
"libheif"
]
| [Uploading IMG_2138.zip…]()
PFA | heif-convert to jpeg failed for some HEIC-files | https://api.github.com/repos/strukturag/libheif/issues/577/comments | 1 | 2021-12-14T11:08:28Z | 2023-05-29T10:48:14Z | https://github.com/strukturag/libheif/issues/577 | 1,079,621,370 | 577 |
[
"strukturag",
"libheif"
]
| Ubuntu 16.04
Compiled with libjpeg8-dev, libjpeg9-dev, libjpeg-turbo8-dev, not luck...
heif-convert -q \<any\> source.HEIC target.jpg
Bogus marker length
Could not write image
Example image: (https://kalendari.fastprint.ua/o_1fmnncgr8j0q1kt6uad1qjf1vkdsa.HEIC)
demo.html (libheif.js) works OK for that file | heif-convert to jpeg failed for some HEIC-files => "Bogus marker length" error | https://api.github.com/repos/strukturag/libheif/issues/575/comments | 5 | 2021-12-12T20:41:48Z | 2024-01-07T18:17:02Z | https://github.com/strukturag/libheif/issues/575 | 1,077,903,373 | 575 |
[
"strukturag",
"libheif"
]
| One more wish: a program heifhead which works similar to jhead. I use jhead to code date in time in the filename like
jhead -ft -n%Y%m%d_%H%M%S
and want to do the same thing with HEIC-files.
Thanks | heifhead as a pendant to jhead | https://api.github.com/repos/strukturag/libheif/issues/573/comments | 1 | 2021-12-05T16:17:09Z | 2022-08-06T13:39:56Z | https://github.com/strukturag/libheif/issues/573 | 1,071,497,947 | 573 |
[
"strukturag",
"libheif"
]
| Is it possible that heif-tumbnailer takes the extension of destination and produces an appropriate file type?
And if the type is jpg, jpeg etc. please add the EXIF-Headers like in heif-convert.
Thanks in advance. | Make heif-thumbnailer to respect the extension of the destination | https://api.github.com/repos/strukturag/libheif/issues/572/comments | 0 | 2021-12-05T15:58:38Z | 2021-12-05T15:58:38Z | https://github.com/strukturag/libheif/issues/572 | 1,071,493,565 | 572 |
[
"strukturag",
"libheif"
]
| Thanks for the tool.
heif-enc and heif-info give information abount themselve. Please add this feature to heif-convert und heif-thumbnailer. | Please add -v to heif-convert and heif-thumbnailer | https://api.github.com/repos/strukturag/libheif/issues/571/comments | 0 | 2021-12-05T15:55:21Z | 2023-06-02T10:01:38Z | https://github.com/strukturag/libheif/issues/571 | 1,071,492,827 | 571 |
[
"strukturag",
"libheif"
]
| i can not get NCLX by heif_image_handle_get_nclx_color_profile
my code:
heif_color_profile_nclx *heif_nclx = heif_nclx_color_profile_alloc();
heif_error err = heif_image_handle_get_nclx_color_profile(handle, &heif_nclx);
//err is heif_error_Color_profile_does_not_exist
| how to get NCLX profile from heif taked by iphone 12 | https://api.github.com/repos/strukturag/libheif/issues/566/comments | 9 | 2021-11-17T09:40:48Z | 2022-05-03T15:30:12Z | https://github.com/strukturag/libheif/issues/566 | 1,055,911,682 | 566 |
[
"strukturag",
"libheif"
]
| [IMG_20211106_180819.zip](https://github.com/strukturag/libheif/files/7517710/IMG_20211106_180819.zip)
台式机ubuntu系统,HEIC转JPG需要7秒钟 | 如何提高HEIC转JPG速度? | https://api.github.com/repos/strukturag/libheif/issues/564/comments | 2 | 2021-11-11T04:19:03Z | 2022-06-16T02:11:42Z | https://github.com/strukturag/libheif/issues/564 | 1,050,556,423 | 564 |
[
"strukturag",
"libheif"
]
| Hello,
I try to compile libheif for armeabi-v7a using CMake on Ubuntu, I have this message error :
```
Linking CXX shared library libheif.so
ld: error: undefined symbol: __assert_fail >>> referenced by de265.cc >>> de265.cc.o:(de265_set_parameter_bool) in archive /home/user/libheif/libde265-master/build/android/armeabi-v7a/libde265/liblibde265.a
...
```
the same code compile correctly for Arm64-v8a.
Thanks | CMake Android NDK error armeabi-v7a "undefined symbol" | https://api.github.com/repos/strukturag/libheif/issues/563/comments | 0 | 2021-11-09T12:50:42Z | 2021-12-22T00:06:56Z | https://github.com/strukturag/libheif/issues/563 | 1,048,569,966 | 563 |
[
"strukturag",
"libheif"
]
| Hello,
Apologies if this is not the right place to ask questions but I couldn't find a forum or a Discussions tab.
I am trying to encode 10 bit grayscale images losslessly in heic. The images are stored as 16 bit png files (but only use the lest significant 10 bits).
If I simply use
```bash
heif-enc -b 10 -L -v -o output-10bit-lsb.heic input-10bit-lsb.png
```
the resulting heic image looks completely dark (using Preview.app on macos 12.0.1) so I guess `heif-enc` does not only use the 10 least significant bits. If I scale / bitshift or left replicate the original intensities in the input png, the generated heic file looks ok on preview.app but I can't get back the original values.
If I simply use
```bash
heif-convert output-10bit-msb.heic recons-10bit-msb.png
```
the resulting png is an 8 bit rgb file. Using imagemagick seems to help there as I can generate 16bit images with
```bash
magick convert output-10bit-msb.heic -depth 10 recons-10bit-msb.png
```
However, the result is not lossless. Is there a way to do such a lossless round-trip with libheif command-line tools?
To ease replicating my issue, below if a simple python script that generates the 10bit image on the fly:
```python
import subprocess
import numpy as np
import tempfile
import imageio
# Create simple image with gradient from
# 0 to (2^bitdepth - 1)
bitdepth = 10
unusedbitdepth = 16-bitdepth
hbd = int(bitdepth/2)
im0 = np.zeros((1<<hbd,1<<hbd),dtype=np.uint16)
im0[:] = np.arange(0,1<<bitdepth).reshape(im0.shape)
# Tile it to be at least 64 pix as x265 encoder may only work
# with image of size 64 and up
im0 = np.tile(im0, (2, 2))
print('im0',np.min(im0),np.max(im0),im0.shape,im0.dtype)
# bitshift it or rescale intensities
im0ref = im0
im0 = (im0<<6) # Bitshift the values to use most significant bits
#im0 = (im0<<6) + (im0>>4) Left bit replication as a cost-effective approximation of scaling (See http://www.libpng.org/pub/png/spec/1.1/PNG-Encoders.html)
#im0 = np.uint16(np.round(im0 * np.float64((1<<16)-1)/np.float64((1<<10)-1))) # Scale the values use all 16 bits
print('im0',np.min(im0),np.max(im0),im0.shape,im0.dtype)
# Save it
tmp0 = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
print(f'Using tmp file: {tmp0.name}')
imageio.imwrite(tmp0.name,im0)
# Encode with heif-enc
tmp1 = tempfile.NamedTemporaryFile(suffix='.heic', delete=False)
mycmd = f'heif-enc -b 10 -L -v -o {tmp1.name} {tmp0.name}'
print(mycmd)
p = subprocess.run(mycmd.split(), capture_output=True)
print( 'stdout:', p.stdout.decode() )
print( 'stderr:', p.stderr.decode() )
if p.returncode:
exit(p.returncode)
# Decode with heif-convert or imagemagick
tmp2 = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
mycmd = f'magick convert {tmp1.name} -depth 10 {tmp2.name}'
#mycmd = f'heif-convert {tmp1.name} {tmp2.name}'
print(mycmd)
p = subprocess.run(mycmd.split(), capture_output=True)
print( 'stdout:', p.stdout.decode() )
print( 'stderr:', p.stderr.decode() )
if p.returncode:
exit(p.returncode)
# Read back
im1 = imageio.imread(tmp2.name)
print('im1',np.min(im1),np.max(im1),im1.shape,im1.dtype)
# Bitshift or scale back
im1pre = im1
im1 = (im1>>6)
#im1 = np.uint16(np.round(im1 * np.float64((1<<10)-1)/np.float64((1<<16)-1)))
print('err: ',np.linalg.norm((np.float32(im1)-np.float32(im0ref)).ravel()))
```
Note that my question is very similar to that I have about doing this with ffmpeg:
https://stackoverflow.com/q/69739665/17261462
In the case of ffmpeg, achieving a lossless roundrip with HEVC is at least possible by using temporary rawvideo file:
https://stackoverflow.com/a/69874453/17261462
For ease of use, I am also attaching some sample pngs generated from teh python commands above.
LSB version:

MSB version:

LBR version:

| Lossless encoding/decoding of 10bit grayscale image stored as 16 bit pngs | https://api.github.com/repos/strukturag/libheif/issues/562/comments | 5 | 2021-11-08T10:14:56Z | 2023-07-20T18:04:34Z | https://github.com/strukturag/libheif/issues/562 | 1,047,260,687 | 562 |
[
"strukturag",
"libheif"
]
| Hello,
how to handle errors in libheif ?
```
heif_context* ctx = heif_context_alloc();
heif_context_read_from_file(ctx, input_filename, nullptr);
// get a handle to the primary image
heif_image_handle* handle;
heif_context_get_primary_image_handle(ctx, &handle);
// decode the image and convert colorspace to RGB, saved as 24bit interleaved
heif_image* img;
heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr);
int stride;
const uint8_t* data = heif_image_get_plane_readonly(img, heif_channel_interleaved, &stride);
```
`std::cout << error << std::endl;`
Thanks | how to handle errors in libheif | https://api.github.com/repos/strukturag/libheif/issues/561/comments | 0 | 2021-11-05T08:04:46Z | 2021-11-05T19:50:48Z | https://github.com/strukturag/libheif/issues/561 | 1,045,544,260 | 561 |
[
"strukturag",
"libheif"
]
| Hello,
using `heif_context_write_to_file(ctx, ofile.toStringz);` a heic file is created,
is-it possible to get a byte array instead of create a file ?
Thanks | heif_context_write_to memory | https://api.github.com/repos/strukturag/libheif/issues/560/comments | 2 | 2021-11-04T12:49:29Z | 2021-11-04T19:56:44Z | https://github.com/strukturag/libheif/issues/560 | 1,044,728,525 | 560 |
[
"strukturag",
"libheif"
]
| Hello,
how to convert a heic image to RGBA 8 bit byte array ?
```
heif_context* ctx = heif_context_alloc();
heif_context_read_from_file(ctx, input_filename, nullptr);
// get a handle to the primary image
heif_image_handle* handle;
heif_context_get_primary_image_handle(ctx, &handle);
// decode the image and convert colorspace to RGB, saved as 24bit interleaved
heif_image* img;
heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr);
int stride;
const uint8_t* data = heif_image_get_plane_readonly(img, heif_channel_interleaved, &stride);
```
I tried :
```
int len = width * height * 4;
char* bits = (char*)malloc(len);
for ( int y = 0; y < height; y++ ){
for ( int x = 0; x < width; x++ ){
int ind1 = x * 4 + (height - 1 - y) * width * 4 ;
int ind2 = x * 4 + y * stride;
*(bits + ind1 ) = *(data + ind2 ); // R
*(bits + ind1 + 1) = *(data + ind2 + 1); // G
*(bits + ind1 + 2) = *(data + ind2 + 2); // B
*(bits + ind1 + 3) = *(data + ind2 + 3); // A
}
}
```
but the image is not correctly created
Thanks | how to convert a heic image to RGBA 8 bit | https://api.github.com/repos/strukturag/libheif/issues/559/comments | 1 | 2021-11-03T06:57:17Z | 2021-11-04T12:47:48Z | https://github.com/strukturag/libheif/issues/559 | 1,043,142,520 | 559 |
[
"strukturag",
"libheif"
]
| Hello,
I am experiencing crashes when Windows GIMP tries to export AVIF images with transparency. It can be reproduced using `heif-enc.exe` under MSYS2 on Windows but for some reason it is not occurring on my Linux.
More information in the following issues:
https://github.com/msys2/MINGW-packages/issues/9869
https://github.com/xiph/rav1e/issues/2836 | Crash when encoding AVIF using rav1e | https://api.github.com/repos/strukturag/libheif/issues/554/comments | 13 | 2021-10-26T13:57:25Z | 2022-08-31T12:58:02Z | https://github.com/strukturag/libheif/issues/554 | 1,036,335,779 | 554 |
[
"strukturag",
"libheif"
]
| Error HeifContext::decode_image_user(heif_item_id ID,
std::shared_ptr<HeifPixelImage>& img,
heif_colorspace out_colorspace,
heif_chroma out_chroma,
const struct heif_decoding_options* options) const
{
Error err = decode_image_planar(ID, img, out_colorspace); //this is wrong,lost a param.
if (err) {
return err;
}
……
} | v1.10.0 is wrong about hdr? | https://api.github.com/repos/strukturag/libheif/issues/553/comments | 3 | 2021-10-21T07:42:44Z | 2021-10-25T06:37:41Z | https://github.com/strukturag/libheif/issues/553 | 1,032,165,089 | 553 |
[
"strukturag",
"libheif"
]
| Is there any way to speed up decodin. e.g.:heif_decode_image
[2021-10-20 112837.zip](https://github.com/strukturag/libheif/files/7379995/2021-10-20.112837.zip)
g
| it takes 4 seconds for 4K image HEIC to decodie | https://api.github.com/repos/strukturag/libheif/issues/552/comments | 10 | 2021-10-20T09:34:48Z | 2024-07-04T16:39:45Z | https://github.com/strukturag/libheif/issues/552 | 1,031,191,377 | 552 |
[
"strukturag",
"libheif"
]
| Now only png is supported, I the input is a tiff file, it will raise `Not a JPEG file: starts with 0x49 0x49`, can I use a tiff file as an input and convert it to heif? | Is there a way to convert from tiff? | https://api.github.com/repos/strukturag/libheif/issues/549/comments | 3 | 2021-10-01T14:47:58Z | 2021-10-11T10:30:38Z | https://github.com/strukturag/libheif/issues/549 | 1,013,438,079 | 549 |
[
"strukturag",
"libheif"
]
| The title says it all. If `ignore_transformations` is `false` (the default), transformations are applied to the image, but not to the thumbnail. This leaves us with incorrect thumbnails.
The issue is observable with literally any iPhone image that is of vertical orientation and has a thumb.
It is worth nothing, rotating the thumb on the user side is only possible if
- Image has exif, which might not be the case.
- User is able to parse exif, which again is trivial. | ignore_transformations must affect the thumbnail | https://api.github.com/repos/strukturag/libheif/issues/548/comments | 0 | 2021-09-24T09:45:08Z | 2021-09-24T10:54:12Z | https://github.com/strukturag/libheif/issues/548 | 1,006,281,540 | 548 |
[
"strukturag",
"libheif"
]
| Hello, First of all thank you so much for this awesome library
So, I have tried the demo live at https://strukturag.github.io/libheif,
I wanted to know if it is by design that the converted file does not have EXIF data
Test FIle - https://drive.google.com/file/d/1c4IDtTjdK_FAl-tDbuNVOTWjGOLyUGnU/view?usp=sharing
Thanks in advance!! | Exif data lost during conversion | https://api.github.com/repos/strukturag/libheif/issues/547/comments | 9 | 2021-09-12T07:30:44Z | 2023-05-16T08:55:08Z | https://github.com/strukturag/libheif/issues/547 | 994,076,493 | 547 |
[
"strukturag",
"libheif"
]
| Hey Team,
I am playing with the javascript version.
Using the library from here:
https://strukturag.github.io/libheif/libheif.js
When I am trying to convert 1.6MB heic image ( taken from iPhone 11 ) into jpeg, it's taking a minimum of 6 secs ( on my iMac ). This is a little too slow for just 1 image.
Looking at the below code:
This particular line is taking about 6 seconds
_this.image_data = this.ctx.createImageData(w, h);_
Is there a way to speed this up ?
CanvasDrawer.prototype.draw = function(image) {
**const start = Date.now();**
var w = image.get_width();
var h = image.get_height();
if (w != this.canvas.width || h != this.canvas.height ||
!this.image_data) {
this.canvas.width = w;
this.canvas.height = h;
if (w > document.body.clientWidth) {
addClass(this.container, "flexible-size");
this.container.style["padding-bottom"] = String(100 * (h / w)) + "%";
} else {
removeClass(this.container, "flexible-size");
this.container.style["padding-bottom"] = "";
}
_this.image_data = this.ctx.createImageData(w, h);_
**const millis = Date.now() - start;
console.log(`seconds elapsed = ${Math.floor(millis / 1000)}`);**
var image_data = this.image_data.data;
// Start with a white image.
for (var i=0; i<w*h; i++) {
image_data[i*4+3] = 255;
}
}
image.display(this.image_data, function(display_image_data) {
hide("decoding");
if (!display_image_data) {
show("error-format");
return;
}
show("container");
if (saveSupported) {
show("save-container");
} else {
hide("save-container");
}
if (window.requestAnimationFrame) {
this.pending_image_data = display_image_data;
window.requestAnimationFrame(function() {
if (this.pending_image_data) {
this.ctx.putImageData(this.pending_image_data, 0, 0);
this.pending_image_data = null;
}
}.bind(this));
} else {
this.ctx.putImageData(display_image_data, 0, 0);
}
}.bind(this));
};
Thank you,
Mandy | libeheif.js very slow | https://api.github.com/repos/strukturag/libheif/issues/545/comments | 0 | 2021-09-02T17:07:30Z | 2021-09-02T17:07:30Z | https://github.com/strukturag/libheif/issues/545 | 986,972,140 | 545 |
[
"strukturag",
"libheif"
]
| Hello,
i have started to use heif-enc and encountered some Problems.
`C:\Heic\heif-enc.exe -q 60 $_.FullName`
viewing the picture with irfanview or Windows Fotos red color is different compared to the original JPG.
With GIMP it looks like the original.
I am also not able to open the picture with SaalDigital Design software, but heic pictures from Galasy S20FE are working fine.
Is there a special option required to get the output file compatible?
I have already tryed
`--matrix_coefficients=0 -p chroma=444`
the effect is that windows and irfanview can not open the picture. With GIMP it is fine.
| Red color is different with Windows Foto and output can not opened with SaalDigital design software | https://api.github.com/repos/strukturag/libheif/issues/544/comments | 1 | 2021-08-29T09:46:11Z | 2021-08-30T10:44:38Z | https://github.com/strukturag/libheif/issues/544 | 982,050,846 | 544 |
[
"strukturag",
"libheif"
]
| Hello, I am experiencing Segmentation fault when decoding these images:
[heic-segfault.zip](https://github.com/strukturag/libheif/files/7067868/heic-segfault.zip)
**Steps to reproduce**
Run the suggested in the Readme.md example code, to read an image, with any of the files from the zip.
**Environment**
libde265 @ 900772c3e9ee1e106b93283fd8e7633d52899e40
libheif @ 9453b49ea8e9b7a0ad022650ce4b386864d2dac3
Edit: Also tested latest 5f948947733bceb5ff243c785265ebeeabbeb170
Both compiled with `-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=NO`.
Edition Windows 10 Pro
Version 21H1
Installed on 13.11.2020 г.
OS build 19043.1165
Experience Windows Feature Experience Pack 120.2212.3530.0
Compiler is mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0
**Debugger console**
```
[New Thread 28408.0x1a4c]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 28408.0x1a4c]
ff_hevc_transform_16x16_add_8_sse4 (_dst=0x348e0d0 '�' <repeats 16 times>, coeffs=0x367b020, _stride=1280) at libde265/x86/sse-dct.cc:1524
1524 const __m128i T00 = _mm_load_si128((__m128i *) (transform16x16_1[0][0]));
=thread-selected,id="5"
```
**Stacktrace**
```
ff_hevc_transform_16x16_add_8_sse4(uint8_t * _dst, const int16_t * coeffs, ptrdiff_t _stride) (libde265\x86\sse-dct.cc:1524)
acceleration_functions::transform_add<unsigned char>(const acceleration_functions * const this, int sizeIdx, uint8_t * dst, const int16_t * coeffs, ptrdiff_t stride, int bit_depth) (libde265\acceleration.h:353)
transform_coefficients<unsigned char>(acceleration_functions * acceleration, int16_t * coeff, int coeffStride, int nT, int trType, unsigned char * dst, int dstStride, int bit_depth) (libde265\transform.cc:230)
scale_coefficients_internal<unsigned char>(thread_context * tctx, int xT, int yT, int x0, int y0, int nT, int cIdx, bool transform_skip_flag, bool intra, int rdpcmMode) (libde265\transform.cc:609)
scale_coefficients(thread_context * tctx, int xT, int yT, int x0, int y0, int nT, int cIdx, bool transform_skip_flag, bool intra, int rdpcmMode) (libde265\transform.cc:649)
decode_TU(thread_context * tctx, int x0, int y0, int xCUBase, int yCUBase, int nT, int cIdx, PredMode cuPredMode, bool cbf) (libde265\slice.cc:3472)
read_transform_unit(thread_context * tctx, int x0, int y0, int xBase, int yBase, int xCUBase, int yCUBase, int log2TrafoSize, int trafoDepth, int blkIdx, int cbf_luma, int cbf_cb, int cbf_cr) (libde265\slice.cc:3665)
read_transform_tree(thread_context * tctx, int x0, int y0, int xBase, int yBase, int xCUBase, int yCUBase, int log2TrafoSize, int trafoDepth, int blkIdx, int MaxTrafoDepth, int IntraSplitFlag, PredMode cuPredMode, uint8_t parent_cbf_cb, uint8_t parent_cbf_cr) (libde265\slice.cc:3964)
read_coding_unit(thread_context * tctx, int x0, int y0, int log2CbSize, int ctDepth) (libde265\slice.cc:4577)
read_coding_quadtree(thread_context * tctx, int x0, int y0, int log2CbSize, int ctDepth) (libde265\slice.cc:4652)
read_coding_quadtree(thread_context * tctx, int x0, int y0, int log2CbSize, int ctDepth) (libde265\slice.cc:4635)
read_coding_quadtree(thread_context * tctx, int x0, int y0, int log2CbSize, int ctDepth) (libde265\slice.cc:4638)
read_coding_tree_unit(thread_context * tctx) (libde265\slice.cc:2861)
decode_substream(thread_context * tctx, bool block_wpp, bool first_independent_substream) (libde265\slice.cc:4741)
thread_task_ctb_row::work(thread_task_ctb_row * const this) (libde265\slice.cc:4991)
worker_thread(LPVOID pool_ptr) (libde265\threads.cc:233)
kernel32.dll!KERNEL32!BaseThreadInitThunk (Unknown Source:0)
ntdll.dll!ntdll!RtlGetAppContainerNamedObjectPath (Unknown Source:0)
ntdll.dll!ntdll!RtlGetAppContainerNamedObjectPath (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)
```
---
**Issue is NOT present under Linux**
The exact codebase is compiled under Ubuntu 20.04, using the exact same options (as far as cmake is concerned), and the issue was not reproduced.
---
**Issue is NOT present when compiling with MSVC (both x64 and x86)**
Looks like the problem is specific to the combination MinGW + Windows.
>Consequently, there is a workaround if one compiles `libde265` as a shared library with MSVC, then compile the rest with MinGW and link to it. Tested and it works.
---
**Issue is NOT present when `libde265` is compiled with `DISABLE_SSE`**
This should be obvious, considering the code is clearly in the optimized image processing. Still, this is tested and confirmed.
| SIGSEGV upon decoding some images with libde265 | https://api.github.com/repos/strukturag/libheif/issues/543/comments | 0 | 2021-08-27T15:16:32Z | 2021-08-29T15:26:30Z | https://github.com/strukturag/libheif/issues/543 | 981,350,087 | 543 |
[
"strukturag",
"libheif"
]
| Because in two places it is not possible to build by 5-10% smaller code.
It would be good to libheif would not be using exceptiions
```console
[tkloczko@barrel libheif-1.12.0]$ make -k
make all-recursive
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0'
Making all in libheif
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/libheif'
/bin/sh ../libtool --tag=CXX --mode=compile /usr/bin/g++ -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I/usr/include/libvmaf -I/usr/include/rav1e -DLIBHEIF_EXPORTS -I.. -DHAVE_VISIBILITY -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-exceptions -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -c -o libheif_la-heif_image.lo `test -f 'heif_image.cc' || echo './'`heif_image.cc
libtool: compile: /usr/bin/g++ -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I/usr/include/libvmaf -I/usr/include/rav1e -DLIBHEIF_EXPORTS -I.. -DHAVE_VISIBILITY -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-exceptions -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -c heif_image.cc -fPIC -DPIC -o .libs/libheif_la-heif_image.o
heif_image.cc: In member function ‘bool heif::HeifPixelImage::ImagePlane::alloc(int, int, int, heif_chroma)’:
heif_image.cc:224:32: error: exception handling disabled, use ‘-fexceptions’ to enable
224 | catch (const std::bad_alloc& excpt) {
| ^~~~~
make[2]: *** [Makefile:1167: libheif_la-heif_image.lo] Error 1
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/libheif'
Making all in examples
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/examples'
make[2]: *** No rule to make target '../libheif/libheif.la', needed by 'heif-convert'.
/usr/bin/g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-exceptions -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -c -o heif_test-heif_test.o `test -f 'heif_test.cc' || echo './'`heif_test.cc
In file included from heif_test.cc:41:
../libheif/heif_cxx.h: In member function ‘void heif::Context::read_from_file(std::string, const heif::Context::ReadingOptions&)’:
../libheif/heif_cxx.h:490:13: error: exception handling disabled, use ‘-fexceptions’ to enable
490 | throw err;
| ^~~
heif_test.cc: In function ‘int main(int, char**)’:
heif_test.cc:168:18: error: ‘err’ was not declared in this scope
168 | std::cerr << err.get_message() << "\n";
| ^~~
make[2]: *** [Makefile:849: heif_test-heif_test.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/examples'
Making all in extra
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/extra'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/extra'
Making all in fuzzing
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/fuzzing'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/fuzzing'
Making all in gdk-pixbuf
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/gdk-pixbuf'
make[2]: *** No rule to make target '../libheif/libheif.la', needed by 'libpixbufloader-heif.la'.
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/gdk-pixbuf'
Making all in gnome
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/gnome'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/gnome'
Making all in go
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/go'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/go'
Making all in scripts
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/scripts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/scripts'
Making all in tests
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/tests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/tests'
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0'
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0'
make[1]: *** [Makefile:537: all-recursive] Error 1
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0'
make: *** [Makefile:446: all] Error 2
```
| 1.12.0: code uses exceptions | https://api.github.com/repos/strukturag/libheif/issues/542/comments | 0 | 2021-08-22T16:13:12Z | 2021-08-22T16:13:12Z | https://github.com/strukturag/libheif/issues/542 | 976,412,713 | 542 |
[
"strukturag",
"libheif"
]
| `MINSIGSTKSZ` is no longer define.
```console
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/libheif-1.12.0/tests'
/usr/bin/g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../. -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -c -o heif_unit_tests-main.o `test -f 'main.cc' || echo './'`main.cc
In file included from /usr/include/signal.h:328,
from catch.hpp:7644,
from main.cc:28:
catch.hpp:10376:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10376 | constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24,
from /usr/include/signal.h:328,
from catch.hpp:7644,
from main.cc:28:
/usr/include/unistd.h:641:17: note: ‘long int sysconf(int)’ declared here
641 | extern long int sysconf (int __name) __THROW;
| ^~~~~~~
In file included from main.cc:28:
catch.hpp:10435:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10435 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
| ^~~~~~~~~~~~
make[2]: *** [Makefile:495: heif_unit_tests-main.o] Error 1
```
| 1.12.0: build fails with latest glibc | https://api.github.com/repos/strukturag/libheif/issues/541/comments | 16 | 2021-08-22T16:03:35Z | 2023-12-10T01:13:55Z | https://github.com/strukturag/libheif/issues/541 | 976,410,605 | 541 |
[
"strukturag",
"libheif"
]
| My first attempt at using libheif from Java got this error:
```
9 ??? 000000000000000000 0 + 0
10 libheif.1.dylib 0x000000015db5b1de heif::HeifFile::get_item_type(unsigned int) const + 26
11 libheif.1.dylib 0x000000015db6f9fc heif::HeifContext::decode_image_planar(unsigned int, std::__1::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const + 56
12 libheif.1.dylib 0x000000015db6f7d6 heif::HeifContext::decode_image_user(unsigned int, std::__1::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const + 44
13 libheif.1.dylib 0x000000015db65ca5 heif_decode_image + 60
14 libjheif1140877567183321958.dylib 0x000000015db33d40 Java_org_violetlib_jheif_JHeif_nativeRead + 160 (jheif.c:36)
```
Given that it was reading the image file, I don't think the problem is in the Java/JNI linkage.
This is 1.12.0 on macOS 11.5.2. | null pointer in HeifFile::get_item_type | https://api.github.com/repos/strukturag/libheif/issues/540/comments | 10 | 2021-08-20T13:57:28Z | 2023-06-05T05:22:50Z | https://github.com/strukturag/libheif/issues/540 | 975,635,752 | 540 |
[
"strukturag",
"libheif"
]
| ```
In file included from /usr/x86_64-pc-linux-gnu/include/signal.h:328,
from catch.hpp:7644,
from main.cc:28:
catch.hpp:10376:58: error: call to non-'constexpr' function 'long int sysconf(int)'
10376 | constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~~~~~~~~~
In file included from /usr/x86_64-pc-linux-gnu/include/bits/sigstksz.h:24,
from /usr/x86_64-pc-linux-gnu/include/signal.h:328,
from catch.hpp:7644,
from main.cc:28:
/usr/x86_64-pc-linux-gnu/include/unistd.h:641:17: note: 'long int sysconf(int)' declared here
641 | extern long int sysconf (int __name) __THROW;
| ^~~~~~~
In file included from main.cc:28:
catch.hpp:10435:45: error: size of array 'altStackMem' is not an integral constant-expression
10435 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
|
```
Full build log: [libheif-1.12.0-build.log](https://github.com/strukturag/libheif/files/7009835/libheif-1.12.0-build.log)
This has been fixed in upstream catch already, see: https://github.com/catchorg/Catch2/issues/2178 | libheif-1.12.0 fails to build tests on systems with glibc 2.34 | https://api.github.com/repos/strukturag/libheif/issues/539/comments | 0 | 2021-08-18T19:54:45Z | 2022-09-02T19:08:33Z | https://github.com/strukturag/libheif/issues/539 | 974,007,020 | 539 |
[
"strukturag",
"libheif"
]
| Firstly, I build the libde265.
If I build using cmake, I get a liblibde265.so in /usr/local/lib/.
If I build using ./autogen.sh && ./configure && sudo make && sudo make install, I get a libde265.so.0.1.1.
Is that correct above ?
Then, I build the libheif.
I run ./autogen.sh && ./configure && sudo make && sudo make install, and there is no error occurred when building.
But when I run the bin heif-convert in examples, it crashed with error "/home/liuyike/Codes/libheif/examples/.libs/heif-convert: symbol lookup error: /home/liuyike/Codes/libheif/libheif/.libs/libheif.so.1: undefined symbol: de265_get_image_full_range_flag
"
I want to know why and how to fix it ?
Environment: Linux version 5.4.0-74-generic (buildd@lcy01-amd64-023) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #83~18.04.1-Ubuntu SMP Tue May 11 16:01:00 UTC 2021 | undefined symbol de265_get_image_full_range_flag when heif-convert running on Linux | https://api.github.com/repos/strukturag/libheif/issues/538/comments | 4 | 2021-08-18T15:46:19Z | 2021-08-23T08:32:04Z | https://github.com/strukturag/libheif/issues/538 | 973,819,371 | 538 |
[
"strukturag",
"libheif"
]
| Hi,
Is a simple inter frame encoding supported? ie IPPPPP.
I can do a main profile encode with all I frames, or mainstillpicture, but any reference frames seems to not work.
Any ideas?
Thanks | main profile image sequence | https://api.github.com/repos/strukturag/libheif/issues/537/comments | 7 | 2021-08-17T17:03:16Z | 2021-08-17T19:36:09Z | https://github.com/strukturag/libheif/issues/537 | 972,893,787 | 537 |
[
"strukturag",
"libheif"
]
| Example code, relatively classic usage:
https://github.com/libgd/libgd/blob/master/src/gd_heif.c#L113
I can only reproduce using one of our tests (other do not have this leak):
https://github.com/libgd/libgd/blob/master/tests/heif/heif_im2im.c#L36
which reads using heif_context_read_from_memory_without_copy.
I am not completely sure where the allocations (2x leak):
=================================================================
==31634==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 2048 byte(s) in 2 object(s) allocated from:
#0 0x7f049d924aa5 in posix_memalign (/lib/x86_64-linux-gnu/libasan.so.5+0x10eaa5)
#1 0x7f049c33eb47 in x265::x265_malloc(unsigned long) (/lib/x86_64-linux-gnu/libx265.so.179+0x45db47)
SUMMARY: AddressSanitizer: 2048 byte(s) leaked in 2 allocation(s).
I also attached the valgrind log (ran it too), but there may be a lot of false positive, or a lot of other issues in x265 ;-)
[vg_logfile.txt](https://github.com/strukturag/libheif/files/6980662/vg_logfile.txt)
I also get that one using decoding on reading from gdSurfaceCreateFromHeif (same file as above), in the vg_logfile_read.txt.
[vg_logfile_read.txt](https://github.com/strukturag/libheif/files/6980682/vg_logfile_read.txt)
Master and 1.12.0
may be related to https://github.com/strukturag/libheif/issues/531
| Possible leak in x265 while decoding | https://api.github.com/repos/strukturag/libheif/issues/535/comments | 3 | 2021-08-13T07:35:08Z | 2023-12-22T06:12:47Z | https://github.com/strukturag/libheif/issues/535 | 970,142,045 | 535 |
[
"strukturag",
"libheif"
]
| Is it possible to use libheif to write pre-encoded HEVC imagery? I'm having trouble determining from the API if it's possible or not, and if so how.
Thanks | Pre-encoded HEVC | https://api.github.com/repos/strukturag/libheif/issues/534/comments | 2 | 2021-07-30T17:12:57Z | 2023-03-01T01:57:29Z | https://github.com/strukturag/libheif/issues/534 | 956,930,521 | 534 |
[
"strukturag",
"libheif"
]
| When encoding heif then comparing it to the source it appears that it is not true lossless, despite using `-p chroma=444 --matrix_coefficients=0 `:
```
heif-enc -L -p chroma=444 --matrix_coefficients=0 -o 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores.heif 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-source.png
heif-convert 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores.heif 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-dest.png
compare -metric mae -verbose 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-source.png 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-dest.png null
2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-source.png PNG 1228x816 1228x816+0+0 8-bit sRGB 2.01913MiB 0.030u 0:00.033
2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-dest.pngPNG 1228x816 1228x816+0+0 8-bit sRGB 2138490B 0.030u 0:00.031
Image: 2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-source.png
Channel distortion: MAE
red: 83.8208 (0.00127902)
green: 49.394 (0.000753703)
blue: 108.444 (0.00165476)
all: 80.5531 (0.00122916)
2011-03-05_03-13_Madeira_159_Funchal,_Mercado_dos_Lavradores-source.png=>null PNG 1228x816 1228x816+0+0 8-bit sRGB 1.88601MiB 1.000u 0:00.674
``` | Lossless is not lossless | https://api.github.com/repos/strukturag/libheif/issues/532/comments | 2 | 2021-07-20T16:07:34Z | 2021-07-21T12:29:21Z | https://github.com/strukturag/libheif/issues/532 | 948,819,803 | 532 |
[
"strukturag",
"libheif"
]
| libheif version: 1.10.0
==25882== 11,296 bytes in 1 blocks are still reachable in loss record 7 of 7
==25882== at 0x4C30FB5: malloc (vg_replace_malloc.c:380)
==25882== by 0x53B7637: alloc_and_init_significant_coeff_ctxIdx_lookupTable() (in /home/ADC/80301694/Work/2021-06-24-Base/TBLMultiMediaCloud/tbl_image/out/lib/Tbl_Image_Kit/lib/libtbl_image_kit.so.1.0.8)
==25882== by 0x539F229: de265_init (in /home/ADC/80301694/Work/2021-06-24-Base/TBLMultiMediaCloud/tbl_image/out/lib/Tbl_Image_Kit/lib/libtbl_image_kit.so.1.0.8)
==25882== by 0x5363B41: heif::register_decoder(heif_decoder_plugin const*) (in /home/ADC/80301694/Work/2021-06-24-Base/TBLMultiMediaCloud/tbl_image/out/lib/Tbl_Image_Kit/lib/libtbl_image_kit.so.1.0.8)
==25882== by 0x4F4AD38: _GLOBAL__sub_I_heif_plugin_registry.cc (in /home/ADC/80301694/Work/2021-06-24-Base/TBLMultiMediaCloud/tbl_image/out/lib/Tbl_Image_Kit/lib/libtbl_image_kit.so.1.0.8)
==25882== by 0x4010732: call_init (dl-init.c:72)
==25882== by 0x4010732: _dl_init (dl-init.c:119)
==25882== by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==25882== by 0x1: ???
==25882== by 0x1FFF00004A: ???
==25882== by 0x1FFF000060: ???
i check the code, there is de265_free function but not be called, looks like missing call deinit_plugin
the issue is found by imagemagick test . | memory leak in de265_init() | https://api.github.com/repos/strukturag/libheif/issues/531/comments | 2 | 2021-07-20T02:39:27Z | 2024-01-17T13:36:14Z | https://github.com/strukturag/libheif/issues/531 | 948,193,927 | 531 |
[
"strukturag",
"libheif"
]
| Hi, thanks for sharing this awesome lib.
I have some problems when I test to read from iPhone's .HEIC file and want to rewrite to .heic.
First I try to use your simple encoding API but not work, after that I use the code from example/heif_enc.cc
but still have this problem.
Here is my code
```
int main(int argc, char** argv) {
const char* file_path = "Path/to/IMG_6894.HEIC";
const char* output_path = "Path/to/vs_output.heic";
vector<string> raw_params = {
"x265:crf=20.5",
"x265:colorprim=smpte170m",
"x265:rdoq-level=1",
"x265:aq-strength=1.2",
"x265:deblock=-2:-2" };
int master_alpha = 1;
int two_colr_boxes = 0;
int thumb_alpha = 1;
int list_encoders = 0;
const char* encoderId = nullptr;
int nclx_matrix_coefficients = 6;
int nclx_colour_primaries = 2;
int nclx_transfer_characteristic = 2;
int nclx_full_range = true;
bool lossless = false;
int logging_level = 0;
int thumbnail_bbox_size = 0;
bool enc_av1f = false;
bool crop_to_even_size = false;
heif_context* ctx = heif_context_alloc();
if (!ctx) {
std::cerr << "Could not create context object\n";
return 1;
}
// get the default encoder
heif_encoder* encoder = nullptr;
heif_context_get_encoder_for_format(ctx, heif_compression_HEVC, &encoder);
#define MAX_ENCODERS 5
const heif_encoder_descriptor* encoder_descriptors[MAX_ENCODERS];
int count = heif_context_get_encoder_descriptors(ctx,
enc_av1f ? heif_compression_AV1 : heif_compression_HEVC,
nullptr,
encoder_descriptors, MAX_ENCODERS);
if (list_encoders) {
show_list_of_encoders(encoder_descriptors, count);
return 0;
}
if (count > 0) {
int idx = 0;
if (encoderId != nullptr) {
for (int i = 0; i <= count; i++) {
if (i == count) {
std::cerr << "Unknown encoder ID. Choose one from the list below.\n";
show_list_of_encoders(encoder_descriptors, count);
return 5;
}
if (strcmp(encoderId, heif_encoder_descriptor_get_id_name(encoder_descriptors[i])) == 0) {
idx = i;
break;
}
}
}
heif_error error = heif_context_get_encoder(ctx, encoder_descriptors[idx], &encoder);
if (error.code) {
std::cerr << error.message << "\n";
return 5;
}
}
else {
std::cerr << "No " << (enc_av1f ? "AV1" : "HEVC") << " encoder available.\n";
return 5;
}
tuple<uint8_t*, int, int, int, int, heif_image*> datas = read_heif_data(file_path);
uint8_t* data = get<0>(datas);
int stride = get<1>(datas);
int width = get<2>(datas);
int height = get<3>(datas);
int has_alpha = get<4>(datas);
int channels = has_alpha ? 4 : 3;
struct heif_image* image = get<5>(datas);
struct heif_error err;
err = heif_image_create((int)width, (int)height,
heif_colorspace_RGB,
has_alpha ? heif_chroma_interleaved_RGBA : heif_chroma_interleaved_RGB,
&image);
(void)err;
heif_image_add_plane(image, heif_channel_interleaved, (int)width, (int)height,
has_alpha ? 32 : 24);
int img_stride;
uint8_t* p = (uint8_t*)heif_image_get_plane(image, heif_channel_interleaved, &img_stride);
cout << "Read Width: " << width << endl
<< "Read Height: " << height << endl
<< "Read Stride: " << stride << endl
<< "Write Width: " << width << endl
<< "Write Height: " << height << endl
<< "Write Stride: " << img_stride << endl
;
for (uint32_t y = 0; y < height; y++) {
uint32_t prow = y * img_stride;
uint32_t irow = y * stride;
uint32_t row_len = width * channels;
memcpy(p + prow, data + irow, row_len);
}
struct heif_error error;
// encode the image
heif_color_profile_nclx nclx;
nclx.matrix_coefficients = (heif_matrix_coefficients)nclx_matrix_coefficients;
nclx.transfer_characteristics = (heif_transfer_characteristics)nclx_transfer_characteristic;
nclx.color_primaries = (heif_color_primaries)nclx_colour_primaries;
nclx.full_range_flag = (uint8_t)nclx_full_range;
heif_image_set_nclx_color_profile(image, &nclx);
//// set the encoder parameters
heif_encoder_set_lossy_quality(encoder, 50);
heif_encoder_set_lossless(encoder, lossless);
heif_encoder_set_logging_level(encoder, logging_level);
set_params(encoder, raw_params);
heif_encoding_options* opts = heif_encoding_options_alloc();
opts->save_alpha_channel = (uint8_t)master_alpha;
opts->save_two_colr_boxes_when_ICC_and_nclx_available = (uint8_t)two_colr_boxes;
if (crop_to_even_size) {
if (heif_image_get_primary_width(image) == 1 ||
heif_image_get_primary_height(image) == 1) {
std::cerr << "Image only has a size of 1 pixel width or height. Cannot crop to even size.\n";
return 1;
}
std::cerr << "Warning: option --even-size/-E is deprecated as it is not needed anymore.\n";
int right = heif_image_get_primary_width(image) % 2;
int bottom = heif_image_get_primary_height(image) % 2;
error = heif_image_crop(image, 0, right, 0, bottom);
if (error.code != 0) {
heif_encoding_options_free(opts);
std::cerr << "Could not crop image: " << error.message << "\n";
return 1;
}
}
heif_image_handle* handle;
error = heif_context_encode_image(ctx, image, encoder, opts, &handle);
if (error.code != 0) {
heif_encoding_options_free(opts);
std::cerr << "Could not encode HEIF/AVIF file: " << error.message << "\n";
return 1;
}
if (thumbnail_bbox_size > 0) {
// encode thumbnail
struct heif_image_handle* thumbnail_handle;
opts->save_alpha_channel = master_alpha && thumb_alpha;
error = heif_context_encode_thumbnail(ctx,
image,
handle,
encoder,
opts,
thumbnail_bbox_size,
&thumbnail_handle);
if (error.code) {
heif_encoding_options_free(opts);
std::cerr << "Could not generate thumbnail: " << error.message << "\n";
return 5;
}
if (thumbnail_handle) {
heif_image_handle_release(thumbnail_handle);
}
}
heif_image_handle_release(handle);
heif_encoding_options_free(opts);
heif_encoder_release(encoder);
error = heif_context_write_to_file(ctx, output_path);
if (error.code) {
std::cerr << error.message << "\n";
return NULL;
}
//write_heif_data(image, 50, output_path);
datas = read_heif_data(output_path);
data = get<0>(datas);
stride = get<1>(datas);
width = get<2>(datas);
height = get<3>(datas);
cout << "Read Width: " << width << endl
<< "Read Height: " << height << endl
<< "Read Stride: " << stride << endl
;
return 0;
}
```
My read_heif_data function is following:
```
tuple<uint8_t*,int,int,int,int, heif_image*> read_heif_data(const char* input_filename) {
heif_context* ctx = heif_context_alloc();
heif_context_read_from_file(ctx, input_filename, nullptr);
int num_images = heif_context_get_number_of_top_level_images(ctx);
// get a handle to the primary image
heif_image_handle* handle;
heif_context_get_primary_image_handle(ctx, &handle);
int img_width = heif_image_handle_get_width(handle);
int img_height = heif_image_handle_get_height(handle);
int has_alpha = heif_image_handle_has_alpha_channel(handle);
struct heif_image* img;
struct heif_error err;
int stride; // bytes per line
uint8_t* data;
// decode the image and convert colorspace to RGB, saved as 24bit interleaved
err = heif_decode_image(handle, &img, heif_colorspace_RGB, has_alpha ? heif_chroma_interleaved_RGBA : heif_chroma_interleaved_RGB, nullptr);
if (err.code) {
heif_image_handle_release(handle);
std::cerr << "Could not decode image: " << ": "
<< err.message << "\n";
return { data, stride, img_width, img_height, has_alpha, img };
}
data = heif_image_get_plane(img, heif_channel_interleaved, &stride);
//err = heif_image_get_nclx_color_profile(img, &nclx);
return { data, stride, img_width, img_height, has_alpha, img };
}
```
Here is the output I got.
```
Read Width: 2268
Read Height: 4032
Read Stride: 6816
Write Width: 2268
Write Height: 4032
Write Stride: 6816
Read Width: 0
Read Height: 0
Read Stride: 6816
```
My Original Input Image like this

and my output .heic file got this

You can see the black border there.
Is there something I need to know?
I'm a newbie in C++.
thanks for the reply. 😄 | Read .HEIC from iPhone and rewrite to .heic got 0 width and height and Image has Black boarder | https://api.github.com/repos/strukturag/libheif/issues/530/comments | 1 | 2021-07-19T01:52:09Z | 2021-07-19T01:56:27Z | https://github.com/strukturag/libheif/issues/530 | 947,182,279 | 530 |
[
"strukturag",
"libheif"
]
| HDR images show incorrectly on the online JavaScript decoder.
Looks like a 16bit output pixel is shown as two 8bit pixels.
Should be easy to fix by explicitly requesting the decoder to output 8bit images.
| Support displaying HDR image in web decoder | https://api.github.com/repos/strukturag/libheif/issues/528/comments | 2 | 2021-07-06T07:53:48Z | 2023-02-15T09:40:33Z | https://github.com/strukturag/libheif/issues/528 | 937,619,078 | 528 |
[
"strukturag",
"libheif"
]
| There is very less documentation available for the go package. It might be sufficient for seasoned programmers but for someone new like me it's difficult to navigate.
I am trying to encode multiple images but couldn't find a way to do that. In the readme of the repository, it's written that you can encode multiple images but I am not sure if its available for Golang too or not.
So far, I am only able to encode a single image using `EncodeFromImage` function.
I will appreciate any help towards the right direction. | How to encode multiple images using go package | https://api.github.com/repos/strukturag/libheif/issues/527/comments | 4 | 2021-07-02T12:00:28Z | 2021-07-05T14:21:40Z | https://github.com/strukturag/libheif/issues/527 | 935,703,555 | 527 |
[
"strukturag",
"libheif"
]
| I just installed libaom as per explained here https://aomedia.googlesource.com/aom/
But then libheif compiling is failing with following error :
```
/usr/bin/ld: /usr/local/lib/libaom.a(tx_search.c.o): relocation R_X86_64_PC32 against symbol `aom_sum_squares_2d_i16' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:828: recipe for target 'libheif.la' failed
make[2]: *** [libheif.la] Error 1
make[2] : on quitte le répertoire « /home/maxence/Desktop/libheif_2 attempts with avif/libheif-master/libheif »
Makefile:536: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1] : on quitte le répertoire « /home/maxence/Desktop/libheif_2 attempts with avif/libheif-master »
Makefile:445: recipe for target 'all' failed
make: *** [all] Error 2
```
Not being that much proficient in Linux (Ubuntu 18/04) I am not too sure on how to fix this | Cannot compile with latest version of libaom | https://api.github.com/repos/strukturag/libheif/issues/526/comments | 1 | 2021-06-28T23:02:45Z | 2021-06-29T11:04:22Z | https://github.com/strukturag/libheif/issues/526 | 932,058,660 | 526 |
[
"strukturag",
"libheif"
]
| I couldn't find any helpful documentation on running a go package of libheif.
I have installed `1.12.0` go package and when running the code, getting the error
```
# pkg-config --cflags -- libheif
Package libheif was not found in the pkg-config search path.
Perhaps you should add the directory containing `libheif.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libheif' found
pkg-config: exit status 1
```
I have cloned this repository and did the installation steps mentioned in the docs, It went smooth. | How to run the golang code | https://api.github.com/repos/strukturag/libheif/issues/525/comments | 2 | 2021-06-20T12:59:06Z | 2021-07-02T11:57:31Z | https://github.com/strukturag/libheif/issues/525 | 925,594,464 | 525 |
[
"strukturag",
"libheif"
]
| With the images from iPhone, image height is 1713, but u and v planes are only 856 high, so the last scan line is out of the u/v planes, so if we compute like
size_t offset_u = (cinfo.next_scanline / 2) * stride_u;
const uint8_t* start_u = &row_u[offset_u];
we reading data are out of limits. That's explains why we have green line at the bottom sometimes.
I suggest that the call like
const uint8_t* row_u = heif_image_get_plane_readonly(image, heif_channel_Cb, &stride_u);
returns plane height as well in addition to stride, in this case we can check the height in the decoding loop and reuse the last u/v line.
I can suggest a patch, but I would prefer to know what author prefer in interface versioning. | crash when converting a heic image when height is odd | https://api.github.com/repos/strukturag/libheif/issues/524/comments | 6 | 2021-06-16T18:25:17Z | 2021-07-12T17:49:43Z | https://github.com/strukturag/libheif/issues/524 | 922,949,232 | 524 |
[
"strukturag",
"libheif"
]
| ````
heif-test.go:39:2: no required module provides package
github.com/strukturag/libheif/go/heif: go.mod file not found in
current directory or any parent directory; see 'go help modules'
````
This might be due to a new requirement of go1.16:
https://stackoverflow.com/questions/66894200/go-go-mod-file-not-found-in-current-directory-or-any-parent-directory-see-go
I don't get the error for go1.13.8.
| compilation with autoconf script fails with 'go' error | https://api.github.com/repos/strukturag/libheif/issues/523/comments | 2 | 2021-06-15T18:57:13Z | 2021-11-18T21:02:14Z | https://github.com/strukturag/libheif/issues/523 | 921,703,585 | 523 |
[
"strukturag",
"libheif"
]
| The RGB-to-YCbCr conversion code in libheif/heif_colorconversion.cc performs chroma subsampling by discarding samples only, without first lowpass filtering (taking a weighted average of) the samples. A representative example is the second nested for loop in
`Op_RGB24_32_to_YCbCr::convert_colorspace()`:
```
std::shared_ptr<HeifPixelImage>
Op_RGB24_32_to_YCbCr::convert_colorspace(const std::shared_ptr<const HeifPixelImage>& input,
ColorState target_state,
ColorConversionOptions options)
{
...
for (int y = 0; y < height; y += chromaSubV) {
const uint8_t* p = &in_p[y * in_stride];
for (int x = 0; x < width; x += chromaSubH) {
uint8_t r = p[0];
uint8_t g = p[1];
uint8_t b = p[2];
p += bytes_per_pixel * chromaSubH;
float cb = r * coeffs.c[1][0] + g * coeffs.c[1][1] + b * coeffs.c[1][2];
float cr = r * coeffs.c[2][0] + g * coeffs.c[2][1] + b * coeffs.c[2][2];
if (full_range_flag) {
out_cb[(y / chromaSubV) * out_cb_stride + (x / chromaSubH)] = clip_f_u8(cb + 128);
out_cr[(y / chromaSubV) * out_cr_stride + (x / chromaSubH)] = clip_f_u8(cr + 128);
}
else {
out_cb[(y / chromaSubV) * out_cb_stride + (x / chromaSubH)] = (uint8_t) clip_f_u8(cb * 0.875f + 128.0f);
out_cr[(y / chromaSubV) * out_cr_stride + (x / chromaSubH)] = (uint8_t) clip_f_u8(cr * 0.875f + 128.0f);
}
}
}
...
}
```
Consider 4:2:0. This nested for loop subsamples each 2x2 block of chroma samples by taking the top-left sample and discarding the rest. This has two problems:
1. The lack of lowpass filtering introduces distortion due to aliasing.
2. The subsampled chroma is positioned at the top-left corner of the 2x2 block. But most YCbCr-to-RGB conversion functions in image decoders assume the chroma sample is positioned at the center of the 2x2 block. So the chroma samples are misaligned.
I will upload a pull request as a proof of concept for a fix.
| Chroma subsampling does not lowpass filter (take average) before discarding samples | https://api.github.com/repos/strukturag/libheif/issues/521/comments | 10 | 2021-06-14T19:08:30Z | 2022-08-15T02:52:05Z | https://github.com/strukturag/libheif/issues/521 | 920,696,850 | 521 |
[
"strukturag",
"libheif"
]
| Hello,
I tried converting some of my own HEIF files taken by my Galaxy S21+ on the online demo. However, the decoded files are luma clipped (I didn't measure, but it could be 16-235). `heif-convert` however, does decode the same files correctly. Had to zip attachments because .heic is not supported.
[20210516_193705.zip](https://github.com/strukturag/libheif/files/6633987/20210516_193705.zip)
Another sample from an iPhone Xs Max, same issue.
[IMG_0640.ZIP](https://github.com/strukturag/libheif/files/6634004/IMG_0640.ZIP)
| libheif.js decodes HEIF files incorrectly | https://api.github.com/repos/strukturag/libheif/issues/520/comments | 1 | 2021-06-10T19:54:18Z | 2021-06-18T13:07:50Z | https://github.com/strukturag/libheif/issues/520 | 917,824,833 | 520 |
[
"strukturag",
"libheif"
]
| Hi,
Do you think it is in the scope of libheif the support for VVC/H.266 still image format? There is already a pretty decent free software implementation of VVC here:
https://github.com/fraunhoferhhi/vvenc
https://github.com/fraunhoferhhi/vvdec/ | VVC/H.266 support | https://api.github.com/repos/strukturag/libheif/issues/519/comments | 45 | 2021-06-09T05:58:47Z | 2024-07-22T18:07:23Z | https://github.com/strukturag/libheif/issues/519 | 915,810,417 | 519 |
[
"strukturag",
"libheif"
]
| After this alpine linux upgrade which upgrade libheif from 1.11 to 1.12 and go from 1.16.4 to 1.16.5, the github.com/h2non/bimg package cannot no longer compile due to LD/linking error?
```
bash-5.1# apk upgrade
(1/7) Upgrading libcurl (7.76.1-r0 -> 7.77.0-r0)
(2/7) Upgrading go (1.16.4-r0 -> 1.16.5-r0)
(3/7) Upgrading libxml2 (2.9.10-r6 -> 2.9.10-r7)
(4/7) Upgrading libheif (1.11.0-r0 -> 1.12.0-r0)
(5/7) Upgrading libheif-dev (1.11.0-r0 -> 1.12.0-r0)
(6/7) Upgrading libxml2-dev (2.9.10-r6 -> 2.9.10-r7)
(7/7) Upgrading libxml2-utils (2.9.10-r6 -> 2.9.10-r7)
```
```
# github.com/h2non/bimg
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libheif.so.1: undefined reference to `de265_get_image_full_range_flag'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libheif.so.1: undefined reference to `de265_get_image_transfer_characteristics'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libheif.so.1: undefined reference to `de265_get_image_colour_primaries'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libheif.so.1: undefined reference to `de265_get_image_matrix_coefficients'
collect2: error: ld returned 1 exit status
```
I checked the libheif 1.12 change log and it not see major updates to the code.
Any help is appreciated. Thanks. | Alpine Linux ld link error when using libheif 1.12 | https://api.github.com/repos/strukturag/libheif/issues/518/comments | 5 | 2021-06-07T09:07:53Z | 2023-06-09T11:29:56Z | https://github.com/strukturag/libheif/issues/518 | 913,320,204 | 518 |
[
"strukturag",
"libheif"
]
| When calling `heif_decode_image` with `heif_chroma_interleaved_RRGGBB_LE` or similar, there is no decoding option for output bit depth. This means that when `HeifContext::decode_image_user` calls `heif::convert_colorspace`, it will pass in a bpp of 0 which is then set to 10 by the interleaved check in that function. This means we cannot request interleaved with a bit depth of 12 or 16. | Cannot decode into >10 bit depth interleaved | https://api.github.com/repos/strukturag/libheif/issues/517/comments | 1 | 2021-06-03T17:30:38Z | 2023-12-31T21:35:14Z | https://github.com/strukturag/libheif/issues/517 | 910,710,012 | 517 |
[
"strukturag",
"libheif"
]
| It seems that `heif_check_filetype` returns `heif_filetype_maybe` when the header is too small? Is this correct?
Shouldn't this code
```
heif_filetype_result heif_check_filetype(const uint8_t* data, int len)
{
if (len < 8) {
return heif_filetype_maybe;
}
if (data[4] != 'f' ||
data[5] != 't' ||
data[6] != 'y' ||
data[7] != 'p') {
return heif_filetype_no;
}
if (len >= 12) {
heif_brand brand = heif_main_brand(data, len);
if (brand == heif_heic) {
return heif_filetype_yes_supported;
}
else if (brand == heif_heix) {
return heif_filetype_yes_supported;
}
else if (brand == heif_avif) {
return heif_filetype_yes_supported;
}
else if (brand == heif_unknown_brand) {
return heif_filetype_no;
}
else if (brand == heif_mif1) {
return heif_filetype_maybe;
}
else {
return heif_filetype_yes_unsupported;
}
}
return heif_filetype_maybe;
}
```
become like this
```
heif_filetype_result heif_check_filetype(const uint8_t* data, int len)
{
if (len < 12) {
return heif_filetype_no;
}
if (data[4] != 'f' ||
data[5] != 't' ||
data[6] != 'y' ||
data[7] != 'p') {
return heif_filetype_no;
}
heif_brand brand = heif_main_brand(data, len);
switch (brand) {
case heif_heix:
case heif_avif:
return heif_filetype_yes_supported;
case heif_mif1:
return heif_filetype_maybe;
case heif_unknown_brand:
return heif_filetype_no;
default:
return heif_filetype_yes_unsupported;
}
}
```
| heif_check_filetype returns heif_filetype_maybe incorrectly? | https://api.github.com/repos/strukturag/libheif/issues/516/comments | 4 | 2021-06-02T12:42:45Z | 2022-09-10T12:37:50Z | https://github.com/strukturag/libheif/issues/516 | 909,460,280 | 516 |
[
"strukturag",
"libheif"
]
| Forwarding downstream Gentoo Linux bug (https://bugs.gentoo.org/790593) as I haven't been able to reproduce on amd64. Please mention if you need any additional logs/information, help is appreciated. Thanks
```
----
/bin/sh ../libtool --tag=CXX --mode=link powerpc64-unknown-linux-gnu-g++ -I/var/tmp/portage/media-libs/libheif-1.11.0/work/libheif-1.11.0 -I.. -I/usr/include/libpng16 -O2 -pipe -frecord-gcc-switches -fdiagnostics-show-option -Wall -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -lpng16 -lz -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -o heif-thumbnailer heif_thumbnailer-encoder.o heif_thumbnailer-heif_thumbnailer.o heif_thumbnailer-encoder_png.o ../libheif/libheif.la -lpthread
# command-line-arguments
./heif-test.go:83:12: undefined: heif.NewContext
./heif-test.go:114:33: undefined: heif.ColorspaceUndefined
./heif-test.go:114:59: undefined: heif.ChromaUndefined
./heif-test.go:143:14: undefined: heif.EncodeFromImage
./heif-test.go:143:38: undefined: heif.CompressionHEVC
./heif-test.go:143:69: undefined: heif.LosslessModeEnabled
./heif-test.go:143:95: undefined: heif.LoggingLevelFull
./heif-test.go:159:38: undefined: heif.GetVersion
make[2]: *** [Makefile:1204: heif-test-go] Error 2
make[2]: *** Waiting for unfinished jobs....
libtool: link: powerpc64-unknown-linux-gnu-g++ -I/var/tmp/portage/media-libs/libheif-1.11.0/work/libheif-1.11.0 -I.. -I/usr/include/libpng16 -O2 -pipe -frecord-gcc-switches -fdiagnostics-show-option -Wall -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -o .libs/heif-thumbnailer heif_thumbnailer-encoder.o heif_thumbnailer-heif_thumbnailer.o heif_thumbnailer-encoder_png.o -lpng16 -lz -Wl,--as-needed ../libheif/.libs/libheif.so -laom -lde265 -ldav1d -lpthread
make[2]: Leaving directory '/var/tmp/portage/media-libs/libheif-1.11.0/work/libheif-1.11.0-.ppc64/examples'
make[1]: *** [Makefile:536: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-libs/libheif-1.11.0/work/libheif-1.11.0-.ppc64'
make: *** [Makefile:445: all] Error 2
* ERROR: media-libs/libheif-1.11.0::gentoo failed (compile phase):
* emake failed
``` | libheif-1.11.0 fails (go) tests on ppc64 | https://api.github.com/repos/strukturag/libheif/issues/515/comments | 0 | 2021-05-28T13:18:00Z | 2021-05-28T13:18:20Z | https://github.com/strukturag/libheif/issues/515 | 905,392,786 | 515 |
[
"strukturag",
"libheif"
]
| I try to set the profile of x265 in libheif to main. (The default is mainstillpicture/msp)
But doing so causes the generated image to be wrong and unreadable. (can't preview)
| libheif examples heif-enc with x265 encoder | https://api.github.com/repos/strukturag/libheif/issues/514/comments | 5 | 2021-05-26T03:14:30Z | 2021-05-27T09:54:56Z | https://github.com/strukturag/libheif/issues/514 | 901,684,913 | 514 |
[
"strukturag",
"libheif"
]
| I'm experimenting with static linking and vcpkg, and I get a lot of undefined linker errors when linking the libraries into my final DLL; it seems `libheif` is trying to reference `libde265` dynamically even when building statically, like:
```
Creating library Release\eXpress.Imaging.Heif.Native.lib and object Release\eXpress.Imaging.Heif.Native.exp
heif.lib(heif_decoder_libde265.cc.obj) : error LNK2019: unresolved external symbol __imp_de265_get_version referenced in function "char const * __cdecl libde265_plugin_name(void)" (?libde265_plugin_name@@YAPEBDXZ)
```
I was able to fix this by modifying the `libheif/CMakeLists.txt` as follows:
```diff
--- a/libheif/CMakeLists.txt
+++ b/libheif/CMakeLists.txt
@@ -54,10 +54,17 @@ set_target_properties(heif
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
-target_compile_definitions(heif
- PUBLIC
- LIBHEIF_EXPORTS
- HAVE_VISIBILITY)
+if(BUILD_SHARED_LIBS)
+ target_compile_definitions(heif
+ PUBLIC
+ LIBHEIF_EXPORTS
+ HAVE_VISIBILITY)
+else()
+ target_compile_definitions(heif
+ PUBLIC
+ LIBHEIF_STATIC_BUILD
+ LIBDE265_STATIC_BUILD)
+endif()
if(LIBDE265_FOUND)
target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1)
```
I'm not sure this is the correct way to do this.
And maybe the `libde265` lib should be modified accordingly?
| Static linking on Windows/MSVC/vcpkg? | https://api.github.com/repos/strukturag/libheif/issues/513/comments | 0 | 2021-05-18T12:03:55Z | 2021-05-18T18:52:37Z | https://github.com/strukturag/libheif/issues/513 | 894,304,582 | 513 |
[
"strukturag",
"libheif"
]
| Sometimes while performing the heif command on linux , i get this error
Although the same command runs successfully most of times. can you please help
` Command failed: heif-convert -q 100 101493.heic 274790.jpg
Could not read HEIF/AVIF file: Invalid input: Unexpected end of file: Extent in iloc box references data outside of file bounds (points to file position 542)`
| Command failed issue in some scenarios | https://api.github.com/repos/strukturag/libheif/issues/512/comments | 2 | 2021-05-17T13:56:01Z | 2021-05-18T06:03:27Z | https://github.com/strukturag/libheif/issues/512 | 893,359,744 | 512 |
[
"strukturag",
"libheif"
]
| This would allow callers to use lossy compression for the image data, and lossless compression for the alpha channel.
[libavif](https://github.com/AOMediaCodec/libavif) already supports this feature, it defaults to using lossless compression for the alpha channel. | Allow separate quality settings for the alpha channel image | https://api.github.com/repos/strukturag/libheif/issues/510/comments | 0 | 2021-05-15T19:15:00Z | 2021-05-15T19:15:00Z | https://github.com/strukturag/libheif/issues/510 | 892,518,319 | 510 |
[
"strukturag",
"libheif"
]
| Thanks for the good work of creating a gdk-pixbuf module. When looking at multiple images after each other using eog, the program start accumulating more and more memory with each image seen (up until I close it or the OOM killer kills it)
Since this only happens with heif photos (in my case, taken by Apple smartphones), I suppose it might be a memory leak in the gdk-pixbuf loader implementation provided here. If there are further details I can provide to help fix this bug, please let me know.
Platform used: Arch Linux
Software versions: libheif 1.12.0, gdk-pixbuf2 2.42.6, eog 40.1 | gdk-pixbuf module memory-leaking | https://api.github.com/repos/strukturag/libheif/issues/509/comments | 1 | 2021-05-15T09:14:17Z | 2021-07-12T17:01:47Z | https://github.com/strukturag/libheif/issues/509 | 892,397,186 | 509 |
[
"strukturag",
"libheif"
]
| So far I have found that HEIF files can have Exif, XMP and MPEG-7 metadata containers.
However, is it correct that most consumer devices like smartphones will save metadata in the Exif format?
Or are xmp and mpeg-7 also common?
Thanks for the info,
Peter
| [Question] Common metadata container formats? | https://api.github.com/repos/strukturag/libheif/issues/505/comments | 1 | 2021-05-13T11:57:50Z | 2021-05-14T22:53:21Z | https://github.com/strukturag/libheif/issues/505 | 890,979,471 | 505 |
[
"strukturag",
"libheif"
]
| Once https://github.com/xiph/rav1e/issues/2730 is resolved, do not pad to 16x16 pixels minimum size anymore.
| rav1e: do not pad to 16x16 minimum image size anymore | https://api.github.com/repos/strukturag/libheif/issues/503/comments | 0 | 2021-05-12T18:08:58Z | 2021-05-12T18:08:58Z | https://github.com/strukturag/libheif/issues/503 | 890,356,451 | 503 |
[
"strukturag",
"libheif"
]
| I'm not sure if this is by design, but the line
```
if (!options || options->ignore_transformations == false) {
```
is not controllable because the options are not passed down from `decode_image_user` to `decode_image_planar`...
I'm having troubles with the conversion from HEIC to JPEG, the orientation is sometimes wrong, no matter what I set `ignore_transformations` to. This might explain this.
| [BUG] decode_image_user is not passing the heif_decoding_options to decode_image_planar | https://api.github.com/repos/strukturag/libheif/issues/498/comments | 5 | 2021-05-10T14:59:17Z | 2021-10-23T16:37:44Z | https://github.com/strukturag/libheif/issues/498 | 884,412,149 | 498 |
[
"strukturag",
"libheif"
]
| Maybe it's a avif-coding error, but just in case:
Test files: https://git.ditoforge.com/mirrors/aom-libavif/src/commit/7637023eabb7589a21358f244ccb8a631c210f10/tests/inputs
heif-convert alpha420.avif alpha420.png (alpha420.png empty) | Alpha channel disappears ? | https://api.github.com/repos/strukturag/libheif/issues/495/comments | 5 | 2021-05-07T08:36:59Z | 2021-05-07T11:18:50Z | https://github.com/strukturag/libheif/issues/495 | 878,611,218 | 495 |
[
"strukturag",
"libheif"
]
| On input with different bpp in the alpha plane than in the color plane, the color-conversion may fail. E.g. in the image from #493, conversion to YCbCr-8bpp fails during RGB (9bit) + alpha (8bit) -> RRGGBB in Op_RGB_HDR_to_RRGGBBaa_BE(). During pipeline creation, this is not detected, as we do not consider the alpha bpp separately.
Add alpha bpp to `ColorState`.
| Support color-conversions with different bpp in alpha plane | https://api.github.com/repos/strukturag/libheif/issues/494/comments | 0 | 2021-05-05T07:42:44Z | 2021-05-05T07:42:44Z | https://github.com/strukturag/libheif/issues/494 | 876,160,243 | 494 |
[
"strukturag",
"libheif"
]
| This was discovered by oss-fuzz (tested [heif plugin](https://invent.kde.org/frameworks/kimageformats/-/blob/master/src/imageformats/heif.cpp) from kimageformats) and re-checked by valgrind (using heif-convert only).
http://188.121.162.14/libheif/leak-3332f16bbeb91fb698a6153c9474d68cb205e3cf.heic
```
==6833== 16,399 bytes in 1 blocks are definitely lost in loss record 2 of 2
==6833== at 0x48395EF: operator new[](unsigned long) (vg_replace_malloc.c:443)
==6833== by 0x48BDD8D: heif::HeifPixelImage::ImagePlane::alloc(int, int, int, heif_chroma) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48BF614: heif::HeifPixelImage::add_plane(heif_channel, int, int, int) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48BF795: heif::HeifPixelImage::copy_new_plane_from(std::shared_ptr<heif::HeifPixelImage const> const&, heif_channel, heif_channel) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48E30E8: Op_to_sdr_planes::convert_colorspace(std::shared_ptr<heif::HeifPixelImage const> const&, heif::ColorState, heif::ColorConversionOptions) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48E0400: heif::ColorConversionPipeline::convert_image(std::shared_ptr<heif::HeifPixelImage> const&) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48E8B35: heif::convert_colorspace(std::shared_ptr<heif::HeifPixelImage> const&, heif_colorspace, heif_chroma, std::shared_ptr<heif::color_profile_nclx const>, int) (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48D9400: heif::HeifContext::decode_image_user(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x48C5B58: heif_decode_image (in /usr/lib64/libheif.so.1.12.0)
==6833== by 0x10BC81: main (in /usr/bin/heif-convert)
==6833==
==6833== LEAK SUMMARY:
==6833== definitely lost: 16,399 bytes in 1 blocks
==6833== indirectly lost: 0 bytes in 0 blocks
==6833== possibly lost: 0 bytes in 0 blocks
```
```
==13==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16399 byte(s) in 1 object(s) allocated from:
#0 0x558d1d in operator new[](unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102:3
#1 0x606197 in heif::HeifPixelImage::ImagePlane::alloc(int, int, int, heif_chroma) /src/libheif/libheif/heif_image.cc:211:21
#2 0x605dc6 in heif::HeifPixelImage::add_plane(heif_channel, int, int, int) /src/libheif/libheif/heif_image.cc:164:13
#3 0x608efa in heif::HeifPixelImage::copy_new_plane_from(std::__1::shared_ptr<heif::HeifPixelImage const> const&, heif_channel, heif_channel) /src/libheif/libheif/heif_image.cc:431:3
#4 0x62e470 in Op_to_sdr_planes::convert_colorspace(std::__1::shared_ptr<heif::HeifPixelImage const> const&, heif::ColorState, heif::ColorConversionOptions) /src/libheif/libheif/heif_colorconversion.cc:2486:17
#5 0x639895 in heif::ColorConversionPipeline::convert_image(std::__1::shared_ptr<heif::HeifPixelImage> const&) /src/libheif/libheif/heif_colorconversion.cc:3034:19
#6 0x63a35f in heif::convert_colorspace(std::__1::shared_ptr<heif::HeifPixelImage> const&, heif_colorspace, heif_chroma, std::__1::shared_ptr<heif::color_profile_nclx const>, int) /src/libheif/libheif/heif_colorconversion.cc:3141:19
#7 0x5ab079 in heif::HeifContext::decode_image_user(unsigned int, std::__1::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const /src/libheif/libheif/heif_context.cc:1034:11
#8 0x578e12 in heif_decode_image /src/libheif/libheif/heif.cc:917:35
#9 0x5663c4 in heif::ImageHandle::decode_image(heif_colorspace, heif_chroma, heif::ImageHandle::DecodingOptions const&) /usr/local/include/libheif/heif_cxx.h:737:23
#10 0x561619 in HEIFHandler::ensureDecoder() /src/kimageformats/src/imageformats/heif.cpp:415:34
#11 0x55c684 in HEIFHandler::ensureParsed() const /src/kimageformats/src/imageformats/heif.cpp:360:18
#12 0x55c5cf in HEIFHandler::read(QImage*) /src/kimageformats/src/imageformats/heif.cpp:75:10
#13 0x55b76e in LLVMFuzzerTestOneInput /src/kimgio_fuzzer.cc:57:14
#14 0x460231 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
#15 0x45f73a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
#16 0x461447 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:745:19
#17 0x461ff5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:883:5
#18 0x45017b in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
#19 0x47a1b2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#20 0x7f99613ff83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
DEDUP_TOKEN: operator new[](unsigned long)--heif::HeifPixelImage::ImagePlane::alloc(int, int, int, heif_chroma)--heif::HeifPixelImage::add_plane(heif_channel, int, int, int)
SUMMARY: AddressSanitizer: 16399 byte(s) leaked in 1 allocation(s).
``` | memory leak | https://api.github.com/repos/strukturag/libheif/issues/493/comments | 1 | 2021-05-05T06:51:18Z | 2021-05-05T07:36:39Z | https://github.com/strukturag/libheif/issues/493 | 876,121,642 | 493 |
[
"strukturag",
"libheif"
]
| I was reading the source code, and found
```
int bpp = (options && options->convert_hdr_to_8bit) ? 8 : 0;
// TODO: check BPP changed
if (different_chroma || different_colorspace) {
img = convert_colorspace(img, target_colorspace, target_chroma, nullptr, bpp);
if (!img) {
return Error(heif_error_Unsupported_feature, heif_suberror_Unsupported_color_conversion);
}
}
```
So it seems that when asking 8-bit output, it is still possible to get 16 bit output because of the TODO? E.g. when color space and chrome of the output is the same, just the bit depth?
If so, this is annoying when concerting to JPEG, since that format only supports 8-bit.
Is there a technical difficulty to fix this TODO?
Thanks,
Peter
| HDR to 8-bit not always outputting 8-bit? | https://api.github.com/repos/strukturag/libheif/issues/492/comments | 0 | 2021-05-04T20:45:56Z | 2021-05-04T20:45:56Z | https://github.com/strukturag/libheif/issues/492 | 875,823,122 | 492 |
[
"strukturag",
"libheif"
]
| Currently when building with Visual Studio 2019 (MSVC 19.28) in total 32 warnings are thrown in the `heif`, `heif-info`, `heif-enc`, `heif-convert` and `heif-test` projects.
All warnings can be [viewed on AppVeyor](https://ci.appveyor.com/project/EwoutH/libheif/build/job/yotd33165h6vxe6m/messages). | Resolve MSVC warnings | https://api.github.com/repos/strukturag/libheif/issues/491/comments | 6 | 2021-05-03T14:28:56Z | 2024-06-27T12:57:25Z | https://github.com/strukturag/libheif/issues/491 | 874,625,295 | 491 |
[
"strukturag",
"libheif"
]
| There should be an option in CMakeLists.txt to also install the gnome thumbnailer files. See #484.
These are the files `heif.thumbnailer` and `heif.xml`/`avif.xml` in the gnome directory.
| Install gnome thumbnailer files with CMake | https://api.github.com/repos/strukturag/libheif/issues/486/comments | 0 | 2021-04-30T09:56:14Z | 2021-07-12T16:53:50Z | https://github.com/strukturag/libheif/issues/486 | 872,258,308 | 486 |
[
"strukturag",
"libheif"
]
| libheif `v1.11.0`
**command**
```
heif-convert test.heic test.png
```
**result**
```
File contains 1 images
Could not decode image: 0: Unsupported feature: Unsupported color conversion
```
[test.heic.zip](https://github.com/strukturag/libheif/files/6363972/test.heic.zip)
| Could not decode image: 0: Unsupported feature: Unsupported color conversion | https://api.github.com/repos/strukturag/libheif/issues/481/comments | 10 | 2021-04-23T08:46:57Z | 2021-05-18T15:42:45Z | https://github.com/strukturag/libheif/issues/481 | 865,895,117 | 481 |
[
"strukturag",
"libheif"
]
| I have a heif file by OPPO Find X3

use heif-convet input.heic out.jpg, the result is

| 10 bits HEIF convert problem | https://api.github.com/repos/strukturag/libheif/issues/480/comments | 3 | 2021-04-21T09:51:06Z | 2021-10-25T06:38:08Z | https://github.com/strukturag/libheif/issues/480 | 863,685,908 | 480 |
[
"strukturag",
"libheif"
]
| Excuse me for the probably irrelevant issue but I didn't find any resource to figure out.
One of the latest releases of libheif acclaims there's a "read all auxiliary images" feature but it's unclear from man and help of heif_enc how to do this. I'd like to investigate aux images in my HEICs taken with the iPhone 12 Pro Max. Thanks. | read all auxiliary images feature is unclear | https://api.github.com/repos/strukturag/libheif/issues/479/comments | 4 | 2021-04-18T12:22:22Z | 2021-04-28T22:02:40Z | https://github.com/strukturag/libheif/issues/479 | 860,651,246 | 479 |
[
"strukturag",
"libheif"
]
| Is this an intentional choice? I haven't seen this behavior in other AVIF writers. It's only 4 bytes, but I know many would prefer to keep files as small as possible while maintaining compliance | major_brand is unnecessarily repeated in compatible_brands | https://api.github.com/repos/strukturag/libheif/issues/478/comments | 5 | 2021-04-14T23:33:32Z | 2021-04-19T19:14:33Z | https://github.com/strukturag/libheif/issues/478 | 858,341,698 | 478 |
[
"strukturag",
"libheif"
]
| The [AVIF specification, Section 2.2.1 _AV1 Item Configuration Property_](https://aomediacodec.github.io/av1-avif/#av1-configuration-item-property) says:
> The syntax and semantics of the **_AV1 Item Configuration Property_** are identical to those of the AV1CodecConfigurationBox defined in [AV1-ISOBMFF], with the following constraints:
>
> - ...
> - The values of the fields in the AV1CodecConfigurationBox shall match those of the Sequence Header OBU in the AV1 Image Item Data.
> - ...
This requirement is not guaranteed by the `heif::fill_av1C_configuration()` method in libheif/libheif/heif_avif.cc because it determines the values of the fields in the AV1CodecConfigurationBox independently, without coordinating with the AV1 encoder.
A reliable way to satisfy this requirement is to parse the AV1 sequence header OBU encoded by the AV1 encoder and set the fields in the AV1CodecConfigurationBox to the parsed values.
Note: I noticed this issue when running the [AVIF Validator](https://gpac.github.io/ComplianceWarden-wasm/avif.html ) on two AVIF images encoded by libheif. See https://bugs.chromium.org/p/chromium/issues/detail?id=1198455#c4. | AVIF requirement: The values of the fields in the AV1CodecConfigurationBox shall match those of the Sequence Header OBU in the AV1 Image Item Data. | https://api.github.com/repos/strukturag/libheif/issues/477/comments | 5 | 2021-04-14T17:43:14Z | 2021-05-06T11:47:17Z | https://github.com/strukturag/libheif/issues/477 | 858,120,522 | 477 |
[
"strukturag",
"libheif"
]
| Hello
I would like to add the support of heif sequence files in our toolkit. SO I have several questions :
1) is libheif supporting heif sequence files
2) if yes, what are the API to get the number of images, and how to access each image of the file
thank you
Vincent Torri
| programmatically accessing the images in an heif sequence file | https://api.github.com/repos/strukturag/libheif/issues/475/comments | 4 | 2021-04-09T09:26:30Z | 2021-04-09T09:56:48Z | https://github.com/strukturag/libheif/issues/475 | 854,347,444 | 475 |
[
"strukturag",
"libheif"
]
| As per instruction on Compiling section, I have run ./autogen.sh and ./configure but when I attempted to run make the compiling process stopped with error
`In file included from encoder_png.cc:29:0:
/usr/include/libpng12/png.h:2657:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Werror=literal-suffix]
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
^
/usr/include/libpng12/png.h:2665:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Werror=literal-suffix]
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
^
/usr/include/libpng12/png.h:2673:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Werror=literal-suffix]
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
^
cc1plus: all warnings being treated as errors
make[2]: *** [heif_convert-encoder_png.o] Error 1
make[2]: Leaving directory `/home/ec2-user/imagemagick/libheif/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ec2-user/imagemagick/libheif'
make: *** [all] Error 2`
I am using:
OS : Amazon Linux AMI - I think Centos family
- I have installed libde256
It's like a C++ runtime causing error, some articles handling error like this with adding the spaces directly to the file, but I think it's not practical since it's a libpng library file.
Is there any suggestion on this issue?
Any help would be appreciated
| Error while 'make' attempt on Amazon Linux AMI | https://api.github.com/repos/strukturag/libheif/issues/473/comments | 4 | 2021-04-08T10:43:01Z | 2021-12-14T04:43:13Z | https://github.com/strukturag/libheif/issues/473 | 853,333,053 | 473 |
[
"strukturag",
"libheif"
]
| I'm currently using the v1.6.2 version, but upgrading to v1.10.0 slowed down the heif decoding process by about 2.8 times.
I think the cause is that the internal processing was changed from YCbCr processing to RGB processing in the correction of v1.7.0.
I would like to use the latest version.
Is it possible to improve the processing speed to the same level as v1.6.2.
- The measurement conditions are as follows.
Images: 8 million pixels to 24 million pixels (100 images)
Processing time: 742msec(v1.6.2) -> 2080msec(v1.10.0) (Average of 100 images. Only the call part of heif_decode_image() )
Environment: Windows10 Enterprise 64bit, CPU Intel (R) Core ™ i7-4790 3.6GHz, RAM 32GB
- Implementation of the calling part of the decoding process(Exclude error handling)
```
ctx = heif_context_alloc();
struct heif_error err;
// read file
err = heif_context_read_from_file(ctx, inputHeifFilePathChar, nullptr);
// get number of image
int num_images = heif_context_get_number_of_top_level_images(ctx);
// get image ids
std::vector<heif_item_id> image_IDs(num_images);
int ret_num = heif_context_get_list_of_top_level_image_IDs(ctx, &image_IDs[0], num_images);
// decode
// convert only the 0th image
int idx = 0;
err = heif_context_get_image_handle(ctx, &image_IDs[0], &handle);
int has_alpha = heif_image_handle_has_alpha_channel(handle);
decode_options = heif_decoding_options_alloc();
encoder->UpdateDecodingOptions(handle, decode_options);
err = heif_decode_image(
handle,
&image,
encoder->colorspace(has_alpha),
encoder->chroma(has_alpha),
decode_options);
// encode
bool written = encoder->Encode(handle, image, outputJpegFilePathChar);
``` | Heif decoding processing speed is degraded in V1.7.0 or later version. | https://api.github.com/repos/strukturag/libheif/issues/472/comments | 7 | 2021-04-06T11:08:10Z | 2022-07-11T21:01:36Z | https://github.com/strukturag/libheif/issues/472 | 851,315,271 | 472 |
[
"strukturag",
"libheif"
]
| In HEIF/HEIC, there is an optional way to signal alpha channel information.
In particular, there's a field called `alpha_channel_use_idc`.
From the HEIF spec:
_"alpha_channel_use_idc equal to 0 indicates that for alpha blending purposes the decoded samples of the associated primary picture should be multiplied by the interpretation sample values of the auxiliary coded picture in the display process after output from the decoding process. alpha_channel_use_idc equal to 1 indicates that for alpha blending purposes the decoded samples of the associated primary picture should not be multiplied by the interpretation sample values of the auxiliary coded picture in the display process after output from the decoding process. alpha_channel_use_idc equal to 2 indicates that the usage of the auxiliary picture is unspecified. Values greater than 2 for alpha_channel_use_idc are reserved for future use by ITU-T | ISO/IEC. When not present, the value of alpha_channel_use_idc is inferred to be equal to 2."_
As far as I can tell, libheif is currently not signaling any alpha channel information (it is optional). This means that it is up to applications to decide whether they want to interpret the alpha in a premultiplied (associated) way or in a non-premultiplied way (unassociated, like in PNG). That is obviously not a good situation: it does look like at least in some cases, iOS is interpreting things in the premultiplied way, while other applications are interpreting things in the PNG way. Needless to say that it is very undesirable to have an image with alpha which can be interpreted/blended in two very different ways.
So I would suggest to _always_ signal this field (to be explicitly set to non-premultiplied, i.e.`alpha_channel_use_idc == 1`), since that is the only way to ensure consistency of decoded images. | Premultiplied vs non-premultiplied alpha in HEIF | https://api.github.com/repos/strukturag/libheif/issues/471/comments | 10 | 2021-04-06T09:20:46Z | 2021-04-27T13:59:23Z | https://github.com/strukturag/libheif/issues/471 | 851,230,781 | 471 |
[
"strukturag",
"libheif"
]
| I am working on using the libav HEVC decoder (ffmpeg) to decode depth images in the meta data of HEIC iphone photos. So I am not using libx265 nor libde265. When I build with neither of them because I am not using them I get an error when running:
`The code execution could not proceed because libx265.dll was not found`
I tried setting
```
set(LIBDE265_FOUND, NOTFOUND)
set(X265_FOUND, NOTFOUND)
```
to let the cmake process know that it shouldnt be included. Is this impossible? should I make my own fork and take any references to libde265 and libx265?
Any help appriciated!! | How to use without libx265 nor libde265 | https://api.github.com/repos/strukturag/libheif/issues/469/comments | 3 | 2021-03-24T15:56:09Z | 2021-03-24T20:02:15Z | https://github.com/strukturag/libheif/issues/469 | 839,873,425 | 469 |
[
"strukturag",
"libheif"
]
| https://cloud.reflexion.tv/nextcloud/index.php/s/iX3tWnrMGKakTp4 contains some HEIF sample files from [Canon EOS R5](https://www.canon-europe.com/cameras/eos-r5/) and [SONY α1](https://www.sony.com/electronics/interchangeable-lens-cameras/ilce-1)
| HEIF files with 10 bits per channel are not properly decoded | https://api.github.com/repos/strukturag/libheif/issues/468/comments | 9 | 2021-03-22T09:03:52Z | 2021-03-22T10:46:48Z | https://github.com/strukturag/libheif/issues/468 | 837,491,817 | 468 |
[
"strukturag",
"libheif"
]
| Hi,
I'm looking for a way to mux heif/heic using HEVC tiles or slices (not heic tile). I tried Nokia's lib but it seemed that it was not work.
In fact, I try to write other boxes according to ISO/IEC 23008-12:2017. I store the slice item using 'hvt1' instead of 'hvc1', and I add the reference of type 'dpnd' to identify the HEVC tile item as the document do. But only half of the image is shown. And I don't know how to fix it. Is there any good suggestions?
Thanks,
Chalice
| support hevc tile encode and decode | https://api.github.com/repos/strukturag/libheif/issues/467/comments | 1 | 2021-03-22T03:31:09Z | 2021-04-28T22:02:11Z | https://github.com/strukturag/libheif/issues/467 | 837,281,589 | 467 |
[
"strukturag",
"libheif"
]
| It currently is not clear which libheif version is used for the online converter https://strukturag.github.io/libheif/.
Can we output the version name `heif_get_version()` somewhere on the page?
| online converter page: show libheif version used | https://api.github.com/repos/strukturag/libheif/issues/466/comments | 1 | 2021-03-19T09:03:41Z | 2021-03-19T09:08:43Z | https://github.com/strukturag/libheif/issues/466 | 835,727,745 | 466 |
[
"strukturag",
"libheif"
]
| Hi,
I'm using image magick and found a heic file can not be loaded.
Then I tried to https://strukturag.github.io/libheif/ , it did not work well.
Here is my test file: [IMG20210103002456.zip](https://github.com/ImageMagick/ImageMagick/files/6122741/IMG20210103002456.zip)
Here is the issue: https://github.com/ImageMagick/ImageMagick/issues/3386
Thanks. | Load some heic file error | https://api.github.com/repos/strukturag/libheif/issues/465/comments | 2 | 2021-03-19T08:25:38Z | 2021-03-19T09:16:47Z | https://github.com/strukturag/libheif/issues/465 | 835,691,857 | 465 |
[
"strukturag",
"libheif"
]
| I am trying to extract the original depth values (in meters) from .heic photos taken using the TrueDepth camera of an iphone. I am referencing one of the example code "heif_convert.cc", but it seems to read in each value as uint_8 and I couldn't figure out how to read them as floats. Can you please help me out? | Unable to extract original depth values from DepthMap. | https://api.github.com/repos/strukturag/libheif/issues/464/comments | 1 | 2021-03-11T09:27:27Z | 2022-10-10T17:02:59Z | https://github.com/strukturag/libheif/issues/464 | 828,964,661 | 464 |
[
"strukturag",
"libheif"
]
| Test file: http://188.121.162.14/libheif/clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5421093193121792.heic
```
==22121== Invalid read of size 4
==22121== at 0x4FF6261: derive_spatial_luma_vector_prediction(base_context*, de265_image*, slice_segment_header const*, int, int, int, int, int, int, int, int, int, int, unsigned char*, MotionVector*) (motion.cc:1739)
==22121== by 0x4FF6BD6: fill_luma_motion_vector_predictors(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, int, int, int, MotionVector*) (motion.cc:1905)
==22121== by 0x4FF6DD4: luma_motion_vector_prediction(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int, int, int) (motion.cc:1978)
==22121== by 0x4FF7051: motion_vectors_and_ref_indices(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int, PBMotion*) (motion.cc:2064)
==22121== by 0x4FF715B: decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) (motion.cc:2102)
==22121== by 0x500FC71: read_prediction_unit(thread_context*, int, int, int, int, int, int, int, int, int) (slice.cc:4136)
==22121== by 0x5010A81: read_coding_unit(thread_context*, int, int, int, int) (slice.cc:4504)
==22121== by 0x50113FB: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4652)
==22121== by 0x50113C3: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4645)
==22121== by 0x5011384: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4641)
==22121== by 0x5011384: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4641)
==22121== by 0x500CEA8: read_coding_tree_unit(thread_context*) (slice.cc:2861)
==22121== Address 0x8c is not stack'd, malloc'd or (recently) free'd
==22121==
==22121==
==22121== Process terminating with default action of signal 11 (SIGSEGV)
==22121== Access not within mapped region at address 0x8C
==22121== at 0x4FF6261: derive_spatial_luma_vector_prediction(base_context*, de265_image*, slice_segment_header const*, int, int, int, int, int, int, int, int, int, int, unsigned char*, MotionVector*) (motion.cc:1739)
==22121== by 0x4FF6BD6: fill_luma_motion_vector_predictors(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, int, int, int, MotionVector*) (motion.cc:1905)
==22121== by 0x4FF6DD4: luma_motion_vector_prediction(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int, int, int) (motion.cc:1978)
==22121== by 0x4FF7051: motion_vectors_and_ref_indices(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int, PBMotion*) (motion.cc:2064)
==22121== by 0x4FF715B: decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) (motion.cc:2102)
==22121== by 0x500FC71: read_prediction_unit(thread_context*, int, int, int, int, int, int, int, int, int) (slice.cc:4136)
==22121== by 0x5010A81: read_coding_unit(thread_context*, int, int, int, int) (slice.cc:4504)
==22121== by 0x50113FB: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4652)
==22121== by 0x50113C3: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4645)
==22121== by 0x5011384: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4641)
==22121== by 0x5011384: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4641)
==22121== by 0x500CEA8: read_coding_tree_unit(thread_context*) (slice.cc:2861)
``` | crash in derive_spatial_luma_vector_prediction | https://api.github.com/repos/strukturag/libheif/issues/463/comments | 0 | 2021-03-04T09:44:25Z | 2021-03-04T09:44:25Z | https://github.com/strukturag/libheif/issues/463 | 821,955,458 | 463 |
[
"strukturag",
"libheif"
]
| When writing unittests, I noticed that saving and loading NCLX/CICP values doesn't work for heif, but it does work for avif.
[heif_avif_cicp_rec2020.zip](https://github.com/strukturag/libheif/files/6063457/heif_avif_cicp_rec2020.zip) | saving nclx/cicp values works for avif but not heif | https://api.github.com/repos/strukturag/libheif/issues/462/comments | 4 | 2021-03-01T17:50:06Z | 2021-03-01T18:56:22Z | https://github.com/strukturag/libheif/issues/462 | 819,105,070 | 462 |
[
"strukturag",
"libheif"
]
| Hello,
This file trigger assertion:
http://188.121.162.14/libheif/Assertion_scaling_list_pred_matrix_id_delta_eq1.heic
Command: `heif-convert Assertion_scaling_list_pred_matrix_id_delta_eq1.heic output.png`
Result:
`libde265/sps.cc:925: de265_error read_scaling_list(bitreader*, const seq_parameter_set*, scaling_list_data*, bool): Assertion 'scaling_list_pred_matrix_id_delta==1' failed.` | Assertion scaling_list_pred_matrix_id_delta==1 failed. | https://api.github.com/repos/strukturag/libheif/issues/461/comments | 0 | 2021-03-01T17:34:45Z | 2021-03-01T17:34:45Z | https://github.com/strukturag/libheif/issues/461 | 819,092,858 | 461 |
[
"strukturag",
"libheif"
]
| Test file: http://188.121.162.14/libheif/Invalid_read_of_size_1.heic
```
==21114== Memcheck, a memory error detector
==21114== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==21114== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info
==21114== Command: heif-convert Invalid_read_of_size_1.heic x.png
==21114==
File contains 1 images
==21114== Invalid read of size 1
==21114== at 0x4FE48AC: put_epel_8_fallback(short*, long, unsigned char const*, long, int, int, int, int, short*) (fallback-motion.cc:269)
==21114== by 0x4FF7536: acceleration_functions::put_hevc_epel(short*, long, void const*, long, int, int, int, int, short*, int) const (acceleration.h:296)
==21114== by 0x4FF87D1: void mc_chroma<unsigned short>(base_context const*, seq_parameter_set const*, int, int, int, int, short*, int, unsigned short const*, int, int, int, int) (motion.cc:205)
==21114== by 0x4FF2BC9: generate_inter_prediction_samples(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, PBMotion const*) (motion.cc:380)
==21114== by 0x4FF7197: decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) (motion.cc:2107)
==21114== by 0x500FC71: read_prediction_unit(thread_context*, int, int, int, int, int, int, int, int, int) (slice.cc:4136)
==21114== by 0x5010A81: read_coding_unit(thread_context*, int, int, int, int) (slice.cc:4504)
==21114== by 0x50113FB: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4652)
==21114== by 0x500CEA8: read_coding_tree_unit(thread_context*) (slice.cc:2861)
==21114== by 0x50116CA: decode_substream(thread_context*, bool, bool) (slice.cc:4741)
==21114== by 0x5012289: read_slice_segment_data(thread_context*) (slice.cc:5054)
==21114== by 0x4FCBC3A: decoder_context::decode_slice_unit_sequential(image_unit*, slice_unit*) (decctx.cc:843)
``` | Invalid read of size 1 | https://api.github.com/repos/strukturag/libheif/issues/460/comments | 1 | 2021-03-01T16:23:12Z | 2021-03-01T17:48:15Z | https://github.com/strukturag/libheif/issues/460 | 819,030,319 | 460 |
[
"strukturag",
"libheif"
]
| Hello,
http://188.121.162.14/libheif/clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5216742642155520.heic
```
==31713== Memcheck, a memory error detector
==31713== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==31713== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==31713== Command: heif-convert clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5216742642155520.heic x.png
==31713==
File contains 1 images
==31713== Invalid read of size 8
==31713== at 0x50623CB: _mm_loadl_epi64 (emmintrin.h:709)
==31713== by 0x50623CB: ff_hevc_put_hevc_epel_pixels_8_sse(short*, long, unsigned char const*, long, int, int, int, int, short*) (sse-motion.cc:987)
==31713== by 0x4FF656C: acceleration_functions::put_hevc_epel(short*, long, void const*, long, int, int, int, int, short*, int) const (acceleration.h:296)
==31713== by 0x4FF7F70: void mc_chroma<unsigned char>(base_context const*, seq_parameter_set const*, int, int, int, int, short*, int, unsigned char const*, int, int, int, int) (motion.cc:205)
==31713== by 0x4FF1DAA: generate_inter_prediction_samples(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, PBMotion const*) (motion.cc:388)
==31713== by 0x4FF61CD: decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) (motion.cc:2107)
==31713== by 0x500F176: read_coding_unit(thread_context*, int, int, int, int) (slice.cc:4314)
==31713== by 0x5010431: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4652)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x500BEDE: read_coding_tree_unit(thread_context*) (slice.cc:2861)
==31713== by 0x5010700: decode_substream(thread_context*, bool, bool) (slice.cc:4741)
==31713== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==31713==
==31713==
==31713== Process terminating with default action of signal 11 (SIGSEGV)
==31713== Access not within mapped region at address 0x0
==31713== at 0x50623CB: _mm_loadl_epi64 (emmintrin.h:709)
==31713== by 0x50623CB: ff_hevc_put_hevc_epel_pixels_8_sse(short*, long, unsigned char const*, long, int, int, int, int, short*) (sse-motion.cc:987)
==31713== by 0x4FF656C: acceleration_functions::put_hevc_epel(short*, long, void const*, long, int, int, int, int, short*, int) const (acceleration.h:296)
==31713== by 0x4FF7F70: void mc_chroma<unsigned char>(base_context const*, seq_parameter_set const*, int, int, int, int, short*, int, unsigned char const*, int, int, int, int) (motion.cc:205)
==31713== by 0x4FF1DAA: generate_inter_prediction_samples(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, PBMotion const*) (motion.cc:388)
==31713== by 0x4FF61CD: decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) (motion.cc:2107)
==31713== by 0x500F176: read_coding_unit(thread_context*, int, int, int, int) (slice.cc:4314)
==31713== by 0x5010431: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4652)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x501035A: read_coding_quadtree(thread_context*, int, int, int, int) (slice.cc:4635)
==31713== by 0x500BEDE: read_coding_tree_unit(thread_context*) (slice.cc:2861)
==31713== by 0x5010700: decode_substream(thread_context*, bool, bool) (slice.cc:4741)
``` | crash | https://api.github.com/repos/strukturag/libheif/issues/459/comments | 1 | 2021-03-01T16:01:49Z | 2021-03-01T18:00:41Z | https://github.com/strukturag/libheif/issues/459 | 819,010,654 | 459 |
[
"strukturag",
"libheif"
]
| [test.zip](https://github.com/strukturag/libheif/files/6059479/test.zip)
heif-convert test.heic test.jpg

libheif 1.11.0
test.heic HEIC 3072x4096 3072x4096+0+0 10-bit YCbCr
exif:Make: OPPO
exif:Model: PEEM00
| Problem with convert heic to jpg | https://api.github.com/repos/strukturag/libheif/issues/458/comments | 2 | 2021-03-01T06:20:47Z | 2021-03-02T10:23:45Z | https://github.com/strukturag/libheif/issues/458 | 818,519,026 | 458 |
[
"strukturag",
"libheif"
]
| Hello,
test file: http://188.121.162.14/libheif/clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5020322681192448.heic
```
==13829== Memcheck, a memory error detector
==13829== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==13829== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==13829== Command: heif-convert clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5020322681192448.heic x.png
==13829==
File contains 1 images
==13829== Invalid read of size 2
==13829== at 0x4929A45: Op_to_sdr_planes::convert_colorspace(std::shared_ptr<heif::HeifPixelImage const> const&, heif::ColorState, heif::ColorConversionOptions) (heif_colorconversion.cc:2480)
==13829== by 0x492CB56: heif::ColorConversionPipeline::convert_image(std::shared_ptr<heif::HeifPixelImage> const&) (heif_colorconversion.cc:3029)
==13829== by 0x492D1D1: heif::convert_colorspace(std::shared_ptr<heif::HeifPixelImage> const&, heif_colorspace, heif_chroma, std::shared_ptr<heif::color_profile_nclx const>, int) (heif_colorconversion.cc:3134)
==13829== by 0x48F4CB8: heif::HeifContext::decode_image_user(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const (heif_context.cc:1023)
==13829== by 0x48E35CB: heif_decode_image (heif.cc:907)
==13829== by 0x10BECE: main (in /usr/bin/heif-convert)
==13829== Address 0x6bee93e is 16,398 bytes inside a block of size 16,399 alloc'd
==13829== at 0x483949E: operator new[](unsigned long) (vg_replace_malloc.c:431)
==13829== by 0x4918D03: heif::HeifPixelImage::ImagePlane::alloc(int, int, int, heif_chroma) (heif_image.cc:192)
==13829== by 0x4918AD1: heif::HeifPixelImage::add_plane(heif_channel, int, int, int) (heif_image.cc:145)
==13829== by 0x4946603: convert_libde265_image_to_heif_image(libde265_decoder*, de265_image const*, heif_image**) (heif_decoder_libde265.cc:135)
==13829== by 0x4946AB2: libde265_v1_decode_image(void*, heif_image**) (heif_decoder_libde265.cc:327)
==13829== by 0x48F52E1: heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (heif_context.cc:1090)
==13829== by 0x48F6437: heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (heif_context.cc:1264)
==13829== by 0x48F4B63: 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)
==13829== by 0x48E35CB: heif_decode_image (heif.cc:907)
==13829== by 0x10BECE: main (in /usr/bin/heif-convert)
``` | Invalid read of size 2 | https://api.github.com/repos/strukturag/libheif/issues/457/comments | 3 | 2021-02-28T19:58:38Z | 2021-04-29T11:39:19Z | https://github.com/strukturag/libheif/issues/457 | 818,294,936 | 457 |
[
"strukturag",
"libheif"
]
| The `pre-commit.hook` script fails silently when `gofmt` is not installed. Consequently, doing a `git commit` returns without error, but does nothing if the command is missing. | git commit fails silently if go is not installed | https://api.github.com/repos/strukturag/libheif/issues/454/comments | 0 | 2021-02-27T19:44:22Z | 2021-02-27T19:44:22Z | https://github.com/strukturag/libheif/issues/454 | 818,003,215 | 454 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.