Bug 221191 - [macOS] Force loading the HEIF reader symbols before transcoding any HEIF image
Summary: [macOS] Force loading the HEIF reader symbols before transcoding any HEIF image
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-31 15:00 PST by Said Abou-Hallawa
Modified: 2021-02-02 13:54 PST (History)
7 users (show)

See Also:


Attachments
Patch (1.91 KB, patch)
2021-01-31 15:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (3.33 KB, patch)
2021-02-01 09:18 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (3.41 KB, patch)
2021-02-01 10:00 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2021-01-31 15:00:35 PST
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.
Comment 1 Said Abou-Hallawa 2021-01-31 15:05:29 PST
<rdar://problem/70942158>
Comment 2 Said Abou-Hallawa 2021-01-31 15:06:47 PST
Created attachment 418833 [details]
Patch
Comment 3 Tim Horton 2021-01-31 16:03:55 PST
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 4 Tim Horton 2021-01-31 18:14:05 PST
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.
Comment 5 Said Abou-Hallawa 2021-02-01 09:18:57 PST
Created attachment 418886 [details]
Patch
Comment 6 Simon Fraser (smfr) 2021-02-01 09:34:44 PST
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
Comment 7 Said Abou-Hallawa 2021-02-01 10:00:10 PST
Created attachment 418891 [details]
Patch
Comment 8 Tim Horton 2021-02-01 18:35:22 PST
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).
Comment 9 EWS 2021-02-02 13:54:37 PST
Committed r272234: <https://trac.webkit.org/changeset/272234>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418891 [details].