I using latest version 1.07 with your great package here to handle heic file. When I test on mac it running fine, but when using production linux server it got this issue:
RuntimeException · Couldn't convert HEIC to JPG: 'sh: 1:
/home/forge/***/releases/20241030101404/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64: Exec format error' | Bin used: 'php-heic-to-jpg-linux-arm64' HEIC:
'/home/forge/***/releases/20241030101404/storage/app/public/01JBEFBC1EBCVDP5E275CX8049.HEIC' Full Command:
'/home/forge/***/releases/20241030101404/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64
"/home/forge/***/releases/20241030101404/storage/app/public/01JBEFBC1EBCVDP5E275CX8049.HEIC"
"/home/forge/***/releases/20241030101404/storage/app/public/01JBEFBC1EBCVDP5E275CX8049.HEIC-1118435979672209af4c71d8.22538345" 2>&1' Output from heif-converter-image exe:
my code is like this.
<?php
namespace App\Actions\File;
use Lorisleiva\Actions\Concerns\AsFake;
use Lorisleiva\Actions\Concerns\AsObject;
use Maestroerror\HeicToJpg;
class ConvertHeicFileToJpeg
{
use AsObject;
use AsFake;
public function handle(string $filePath): false|string
{
if (! file_exists($filePath)) {
return false;
}
$filename = pathinfo($filePath, PATHINFO_FILENAME) . '.jpg';
$dirname = pathinfo($filePath, PATHINFO_DIRNAME);
$newFilepath = $dirname . '/' . $filename;
if (PHP_OS_FAMILY == 'Darwin') {
HeicToJpg::convertOnMac($filePath)->saveAs($newFilepath);
} else {
HeicToJpg::convert($filePath, "", true)->saveAs($newFilepath);
}
return $filename;
}
}
I using latest version 1.07 with your great package here to handle heic file. When I test on mac it running fine, but when using production linux server it got this issue:
my code is like this.