Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround bug in macOS 14.4.1 and later where encoding HEIC fails #69

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

kyleerhabor
Copy link
Contributor

Closes #66 and #68.

@kyleerhabor
Copy link
Contributor Author

CC: @rlxone

@CasualDeveloper
Copy link

CasualDeveloper commented Aug 29, 2024

Whoops, didn't mean to do that. Sorry!

Meant to ask Kyle, do you have a test build with your fix?

@rlxone
Copy link
Owner

rlxone commented Aug 29, 2024

Hi, thanks for the fix, do we know what versions were affected? Is it still an issue?

@rlxone
Copy link
Owner

rlxone commented Aug 29, 2024

Can't reproduce on my M1 Mac Mini (macOS 14.6.1 (23G93)) using images from #66.
Do you use macs with intel processors?
image

@rlxone
Copy link
Owner

rlxone commented Aug 29, 2024

Hey @dreampiggy, sorry for bothering you, but seems like you investigated this issue a lot. What is the current state of the issue? Have we reported this bug to Apple? Can't find any info...

@dreampiggy
Copy link

dreampiggy commented Aug 30, 2024

No. I didn't fired radar for this.

The HEVC encoding seems fails on macOS 15.0 beta, whatever compression quality is used. So it's not the same issue.

Actually, I faced 2 issue about HEVC encoding.

  1. Using VM (Github Action environment or anything use Virtualization framework) will cause HEVC encoding failed, on macOS 14.4.x-14.5.x (seems fixed on some OS upgrade)
  2. Using macOS 15 Beta 1-5 will cause HEVC encoding failed, seems fixed on Beta 6

And actually, some Mac hardware may not support HEVC encoding. You should use API to test (do not assume all Mac supports HEVC encoding).

Use public API like CGImageDestinationCopyTypeIdentifiers to check public.heic

Or use https://stackoverflow.com/questions/50956097/determine-if-ios-device-can-support-hevc-encoding to have a try

@dreampiggy
Copy link

dreampiggy commented Aug 30, 2024

Actually, if Apple's framework is not trustable, you can provide a fallback workaround

Since HEVC/HEIF is standard, there are also open-source encode/decode lib, like https://github.com/strukturag/libheif

The C lib I have a Xcode/SPM port: https://github.com/SDWebImage/libheif-Xcode


If you don't like the C API, just use my wrapper API for encoding https://github.com/SDWebImage/SDWebImageHEIFCoder. But this lib don't support HEIF image collection/image sequences (which means, something like dynamic wallpaper you need).😂

@kyleerhabor
Copy link
Contributor Author

Hello,

@CasualDeveloper here is a build with the relevant changes included.

@rlxone this continues to be a relevant issue. If you're not experiencing this on your M1 Mac Mini, then the issue may be Intel-specific, as my 2019 MacBook Pro running macOS Sonoma 14.6.1 (23G93) exhibits the bug. Unfortunately, I'm not aware of the exact affected version range except for 14.4.1 being a start.

@zgosalvez
Copy link

zgosalvez commented Aug 31, 2024

I tried @kyleerhabor’s build and I can confirm that it works successfully on my Intel-based Mac (Sonoma 14.6.1). ✅

Hello,

@CasualDeveloper here is a build with the relevant changes included.

@rlxone this continues to be a relevant issue. If you're not experiencing this on your M1 Mac Mini, then the issue may be Intel-specific, as my 2019 MacBook Pro running macOS Sonoma 14.6.1 (23G93) exhibits the bug. Unfortunately, I'm not aware of the exact affected version range except for 14.4.1 being a start.

@CasualDeveloper
Copy link

CasualDeveloper commented Sep 1, 2024

@rlxone @kyleerhabor

I can also confirm that Kyle's build works on my MacBook Pro (2019, Intel i9) running latest macOS Sonoma 14.6.1

(btw @zgosalvez that fix was Kyle's not mine, so all credit to them 🙂)

@CasualDeveloper
Copy link

CasualDeveloper commented Sep 2, 2024

FYI I've filed a radar in Feedback Assistant on this issue, and also a copy of it on OpenRadar.

@CasualDeveloper
Copy link

CasualDeveloper commented Sep 3, 2024

Hey y'all, good news! 😊

The bug doesn't seem to occur on my MacBook Pro (2019, Intel i9) running macOS Sequoia 15.0 Beta (24A5331b) – tested with Equinox v3.0 from App Store.

Operation of creating an Appearance-type wallpaper with two images completes successfully (I'm assuming with 1.0 quality, since the files sizes seem bigger compared to using 0.9999999 quality)

@kyleerhabor
Copy link
Contributor Author

That's great. I wouldn't mind amending this pull request with checks for the earliest resolved version (either Sequoia 15 or a later version of Sonoma) and an Intel device.

@rlxone
Copy link
Owner

rlxone commented Sep 6, 2024

Thank you all for helping with this!
@kyleerhabor feel free to go ahead, i can merge it as soon as you ready with the new additions.

@kyleerhabor
Copy link
Contributor Author

@rlxone I've added the additions.

@rlxone
Copy link
Owner

rlxone commented Sep 8, 2024

@kyleerhabor sweet, i'll review tomorrow

@rlxone rlxone merged commit cd72ce8 into rlxone:main Sep 10, 2024
1 check passed
@rlxone
Copy link
Owner

rlxone commented Sep 10, 2024

@kyleerhabor looks good to me, i'll release a new app store build in a couple of days.
Thanks everyone for helping with this again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants