MaestroError / php-heic-to-jpg

The easiest way to convert HEIC images to JPEG with PHP and Laravel framework
MIT License
148 stars 20 forks source link

Error reading "meta" box: got box type "mdat" instead #15

Closed EnguerranMeens closed 1 year ago

EnguerranMeens commented 1 year ago

Hello !

Today, I tried to use your library to convert HEIC to JPEG. However, when I attempted to use it, I encountered an error. I tried to debug the issue by executing the command directly :

/Applications/MAMP/htdocs/captus/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-darwin-amd64 "/pathtomyfile/8ivB0GLCbsWkfeHnfTbzZDC4pJP9YOAFeb9giBCH.heic" "/pathtomyfilet/8ivB0GLCbsWkfeHnfTbzZDC4pJP9YOAFeb9giBCH.heic-1943393784644fce698a1fe9.91263079"

I got this error :

2023/05/01 16:36:39 error reading "meta" box: got box type "mdat" instead

My code :

$fileIsHeic = HeicToJpg::isHeic(public_path($data['hunts'][$i]['imagesTemplates'][$k]['image'])); if ($fileIsHeic) { $imageName = $this->generateRandomString(10); HeicToJpg::convertOnMac(public_path($data['hunts'][$i]['imagesTemplates'][$k]['image']), "amd64")->saveAs(public_path("/upload/tmp/test.jpg")); $data['hunts'][$i]['imagesTemplates'][$k]['image'] = "/upload/tmp/" . $imageName . ".jpg"; dump("ok");die(); }

Can you help me ?

Thanks !

MaestroError commented 1 year ago

Hi, @EnguerranMeens! Thanks for the feedback. I already know about this error, it happens when you are trying to convert a non-iPhone generated HEIF files (from Samsung or web) and I am working to add support for "mdat" types too šŸ‘ I will let you know about the update, but can't say now how long will it take, sorry

EnguerranMeens commented 1 year ago

Hello ! Thanks for your answer and for the explanation !

MaestroError commented 1 year ago

New release is here! @EnguerranMeens Please refer to the docs update, let me know if you will have any questions šŸ‘