MaestroError/php-heic-to-jpg

convert not working on arm64 structure

calien666 opened this issue ยท 5 comments

I searched a solution for manipulating wrong loaded .heic files as jpeg, because I need the exif data from the files.

Your solution was a hope for getting this done.

Unfortunately I'm working on MacOS with ARM structure, which means, even my docker container executing the server runs with aarm64. Executing the convert errors to the following:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
PHP Fatal error:  Uncaught RuntimeException: Couldn't convert HEIC to JPG:  in /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php:77
Stack trace:
#0 /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php(33): Maestroerror\HeicToJpg->processImage('/var/www/html/p...')
#1 /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php(123): Maestroerror\HeicToJpg->convertImage('/var/www/html/p...')
#2 /var/www/html/public/test.php(7): Maestroerror\HeicToJpg::convert('/var/www/html/p...')
#3 {main}
  thrown in /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php on line 77

Fatal error: Uncaught RuntimeException: Couldn't convert HEIC to JPG:  in /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php:77
Stack trace:
#0 /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php(33): Maestroerror\HeicToJpg->processImage('/var/www/html/p...')
#1 /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php(123): Maestroerror\HeicToJpg->convertImage('/var/www/html/p...')
#2 /var/www/html/public/test.php(7): Maestroerror\HeicToJpg::convert('/var/www/html/p...')
#3 {main}
  thrown in /var/www/html/vendor/maestroerror/php-heic-to-jpg/src/HeicToJpg.php on line 77

Is there any possibility getting this cool library work on aarm architecture, too?

Used architechutre:

Linux web 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux

@calien666 First of all, thank you for the feedback! I will try to test it on arm64 and find out more about the issue ๐Ÿ‘

Before it, please provide any other information you have about the issue. For example, what do the "wrong loaded .heic files" mean and can you share a file?

Also, if you can try this solution using another platform with the same setup and the same photos, can be useful ๐Ÿ‘

@calien666 First of all, thank you for the feedback! I will try to test it on arm64 and find out more about the issue ๐Ÿ‘

Thank you for this.

Before it, please provide any other information you have about the issue. For example, what do the "wrong loaded .heic files" mean and can you share a file?

I'm working an a migration, where users uploaded .heic files with file ending .jpeg to get them into system. Now I'm trying to extract metadata from these files and php errors, as exif_read_data() and getimagesizes() can't handle heic/heif files, but reads magic.mime from files.

Also, if you can try this solution using another platform with the same setup and the same photos, can be useful ๐Ÿ‘

Currently not possible, as I'm developing on an arm structure, sorry for that

@calien666 I tried to build it for MacOS, but couldn't. I added a new issue about it, you can check it out here

Thank you. For the moment, I'm working with IMagick() for conversion and this is doing the stuff, I need.

Nice @calien666 ๐Ÿ‘ I think I found a solution and updated it with MacOS executable, but not tested yet. Also updated the documentation for macOS users and planing new release now. I will attach new exes here too.

In case you ever use this again on arm64, please get back to me with feedback ๐Ÿ‘

php-heic-to-jpg-macos.zip