Transcoding the HEIF images requires loading the HEIF reader symbols which is not happening in macOS Catalina. The bug has been fixed in the underlaying frameworks of macOS Big Sur. But since the trunk WebKit can run on macOS Catalina, we need a workaround for this bug in WebKit itself.
<rdar://problem/70942158>
Created attachment 418833 [details] Patch
Comment on attachment 418833 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418833&action=review > Source/WebCore/platform/graphics/cg/ImageUtilitiesCG.cpp:54 > + // This will force ImageIO to load the symbols of the HEIF reader. This should probably reference the ImageIO radar. > Source/WebCore/platform/graphics/cg/ImageUtilitiesCG.cpp:55 > + auto sourceMIMEType = MIMETypeFromUTI(sourceUTI); The workaround should be scoped only to OS versions where the underlying bug is not fixed, so that this code naturally evaporates when the fix is globally available. Other than that, this seems reasonable.
Comment on attachment 418833 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418833&action=review >> Source/WebCore/platform/graphics/cg/ImageUtilitiesCG.cpp:55 >> + auto sourceMIMEType = MIMETypeFromUTI(sourceUTI); > > The workaround should be scoped only to OS versions where the underlying bug is not fixed, so that this code naturally evaporates when the fix is globally available. Other than that, this seems reasonable. Also, you only need to run it once per process.
Created attachment 418886 [details] Patch
Comment on attachment 418886 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418886&action=review > Source/WTF/ChangeLog:5 > + https://bugs.webkit.org/show_bug.cgi?id=221191 > + You need a radar number here
Created attachment 418891 [details] Patch
I tried to come up with a concise alternative HAVE name that mentioned the behavior instead of the radar # and came up empty (or with paragraphs).
Committed r272234: <https://trac.webkit.org/changeset/272234> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418891 [details].