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

Use xcframework distribution of WebP #66

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

liamnichols
Copy link
Contributor

@liamnichols liamnichols commented Oct 19, 2021

Hello Twitter 👋

As I am sure that you are aware, TIP had to make some compromises for WebP support and Mac Catalyst since no xcframework distribution of WebP existed. I'm happy to announce however that starting with 1.2.0, this is no longer the case!

https://groups.google.com/a/webmproject.org/g/webp-discuss/c/LwWaVfKbJGc/m/IjpeggKnAAAJ
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html

With xcframeworks, we no longer need to both support both compiling webp as well as using precompiled frameworks. In this pull-request I take a first attempt at getting it up and running.

Why

  1. Simplify repo by removing the webp source code in favour of just managing the xcframework from Google
  2. Modernise the project by using the latest and (kind of) greatest tech (xcframeworks)
  3. Support building TIP on iOS Simulators when using Apple silicon

How

I'm able to achieve this by doing the following:

  1. Downloading the 1.2.1 1.2.2 release of WebP direct from the source
  2. 'Patch'/'Modify' the headers in the .xcframeworks file (more info here)
  3. Remove the webp target and old .framework files
  4. Add the replacement .xcframeworks
  5. Remove the workaround in TIPXWebPCodec.m for importing the libraries
  6. Made a minor fix in the Swift Example App (related to some code that wasn't updated from Update to v2.50.0 #62 i think)
  7. Update the podspec and validate using pod spec lint

What Next?

Firstly, i'm not sure if you are happy just using the binaries that I have pushed in this PR.. Please feel free to download again from the link above and apply the modifications in step 2 yourself.

Secondly, I from what I gather, Twitter might not use this repository directly internally so you might want to land this change in some other way? I've verified that all of the targets in the TwitterImagePipeline Xcode Project compile and run the tests as expected. I've also verified in my own project which uses both TIP and the WebP Codec via the CocoaPods integration that things work as expected!

Thanks again! Please let me know if there is anything else that I can do to help

@liamnichols
Copy link
Contributor Author

Bug tracking changes needed for the headers of the XCFramework bundles - https://bugs.chromium.org/p/webp/issues/detail?id=542#c1

@liamnichols
Copy link
Contributor Author

The bug with the way that XCFramework bundles were packaged has been resolved in 1.2.2, which is currently in RC with an expected release of early Q1 2022. When it happens, I'll update this fork to use the official release although there is not really any difference.

@liamnichols
Copy link
Contributor Author

1.2.2 was officially released with the working .xcframework bundles available to download from here: http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2-ios-framework.tar.gz

In 5008013, I just copied those versions into this repo.

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

Successfully merging this pull request may close these issues.

1 participant