Couldn't convert HEIC to JPG
DanielMescoloto opened this issue ยท 8 comments
I am on Windows 11, using WampServer.
I had no problems with your image test, but with this attached image, It's not working
image2.zip
Hi @DanielMescoloto! Thanks for the feedback, I will check your image, but before it, can you provide any error message from your issue or some more information about it?
Hey @MaestroError
The error was "Couldn't convert HEIC to JPG: '' | Bin used: 'heicToJpg' HEIC: pathFile PathFileWithHash
besides that, I don't know any other details that I could give you.
Hey @DanielMescoloto ! In this error should be the "Full Command:" section, please run that command manually and show me the output ๐
Hi @MaestroError
I have similar problemem and I think managed to narrow it down.
Most files that pass the conversion are photos taken on iPhone.
Most of those that don't pass are made on other phones (i have a Samsung s20fe and it will not work) or converted to heic using online converters like https://www.xconvert.com/convert-jpg-to-heic.
I attached a file that will not convert.
samsung.heic.zip
From what i can see in Hex Editor, there is a difference in file header.
I also have some output from errors from calling bin by hand on linux:
Bin used: 'heicToJpg'
command:
/var/www/html/my_app/vendor/maestroerror/php-heic-to-jpg/src/../bin/heicToJpg "/var/www/html/my_app/tmp/import/01with-heic.heic" "/var/www/html/my_app/tmp/import/01with-heic.heic-16389881356441b846e51331.95246765"
error:
2023/04/24 12:09:20 error reading "meta" box: got box type "mdat" instead
file:
01with-heic.heic.zip
Hi, @pbs-dg ! I had the same theory, thanks for clarifying it, I appreciate your support ๐
Here are the next questions, how often we can face non-iPhone-generated HEIC pictures, does Samsung use it? And what or why is there a difference? I will keep investigating too ๐ค
@pbs-dg As it seems we got here an issue with adrium/goheif package, which is forked from jdeng/goheif, they both have the same issue opened:
adrium/goheif#8
jdeng/goheif#17
Hope they will fix it, for any case, I will search for alternatives when I will get time for it. Thanks again for motivation ๐
@MaestroError currently, from what I see on production, heic is delivered only from iPhone users. That is why we decided to ignore this issue for now and deploy change on production.
When it comes to Samsung phones, by default all photos are made in jpg format. If you want heic, you need to enable it by hand so currently it is no a big deal, but I now Samsung to well and can bet that they will enable it by default in te future.
Let's hope it will be fixed before that happens.