php-heic-to-jpg: Couldn't covert HEIC to JPG

RuntimeException : Couldn't convert HEIC to JPG: '' | Bin used: 'php-heic-to-jpg-darwin-arm64' HEIC: '/private/var/folders/xq/bbvlc8r52gsfpxxg6f7f3_p40000gn/T/bjDSfN' Full Command: '/path/to/project/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-darwin-arm64 "/private/var/folders/xq/bbvlc8r52gsfpxxg6f7f3_p40000gn/T/bjDSfN" "/private/var/folders/xq/bbvlc8r52gsfpxxg6f7f3_p40000gn/T/bjDSfN-6597740986440740f359aa1.01134626"'

Output of command:

[1]    41341 killed

Update: still no fix, but I have some more info.

Fails:

HeicToJpg::convertOnMac($tempPath, 'arm64')->saveAs($tempPath);

Passes:

HeicToJpg::convertOnMac($tempPath, 'amd64')->saveAs($tempPath);

I’m using an M1 MacBook Air. convert also fails, presumably because the OS is detected as arm64, and the bin for that is failing.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 20 (10 by maintainers)

Most upvoted comments

@MaestroError thank you, but I used this JS library and it cover all my needs https://github.com/alexcorvi/heic2any

Hey, @XbNz ! Any updates? Did you fix the issue?

Missed the notification 😄

No, I was not able to find a fix. The solution for me was to use the Linux binaries in production, and when I’m running my test suite on Mac, I need to manually set it to use the convertOnMac AMD64 binary which works for me, as I mentioned previously.

@XbNz Wow! It is a really strange issue 😄 Not sure for now, I know who uses the amd64, but he isn’t on M1, so not sure what is the problem here.

I think the mapping isn’t entirely correct. I ran into the same issue some time ago. I believe M1 is always arm64 arch, can’t be amd64.

@XbNz So if amd64 works for you, Why don’t you just use it? (convertOnMac($tempPath, 'amd64')) it seems you have M1 but with amd64 architecture. Can you check your arch?