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

Rebase active branch to include latest changes from Upstream #2

Open
wants to merge 27 commits into
base: request-modifier
Choose a base branch
from

Conversation

esme-putt
Copy link

This PR merges in the changes from the upstream repository.

bpollman and others added 27 commits May 18, 2021 10:40
…rest#600)

* On iOS, decode WebP images directly into a buffer Core Animation likes

Without this change, the images we output aren't compatible with the GPU and so CA has to copy them all on the main thread at commit time, which means stutters. Plus memory bloat.

The difference here is so substantial that you may seriously want to consider re-running a WebP experiment if you did in the past and bailed on it.

* Try use system decode first if possible

* Do it the same on both platforms

* Fix comment

* But do it right
…IgnoreCache is provided

Otherwise it might be confusing (and surprising) that actually used network client return locally cached data

There is an use case in Pinterest that expects one resonpose never be cached.
Set cachePolicy accordingly when PINRemoteImageManagerDownloadOptions is provided
…ed (pinterest#610)

* initial commit

* PINDiskCacheError is both enum type and a function that confuses compiler, but not sure why only issue on iphone 8

* not use PINDiskCacheLog as it doesn't use PINCache

* use requiresSecureCoding:NO for unarchiving as many classes not comform to NSSecureCoding

* revert renames and address other comments
Disable asserts in release builds when using Swift Package Manager
* attempt to reduce testImageRequestIgnoresLocalData flakiness #2

* Use newer Xcode for CI

* Fix Carthage job

Co-authored-by: rruizmurguia <[email protected]>
* Add APNG image support

* Add the PIN_APNG flag and some unit test

* Add APNG into Example-Mac/Swift-Example

* Fix compile error when APNG disabled

* Fix CI compile environment issues
Before this change, if you attempted to use a dynamic image for a placeholder
(e.g. an image from an asset catalog that has both dark and light versions)
you would get unpredictable results. This is because PINAnimatedImageView
is drawing the image directly to the layer without consulting the view's
current trait collection. So which version of the image you get depends
entirely on what the global `UITraitCollection.currentTraitCollection` is.

According to Apple, "UIKit updates the value of this property before calling
several well-known methods of UIView, UIViewController, and UIPresentationController."
Though they do not say what those methods are, experimentation concludes
that "displayLayer:" is not one of those.

To solve this, we need to make sure that when we generate the CGImage,
we are explicit about using the view's trait collection so that we
get the correct image.
Fix the missing imports at the umbrella file
Fix for the SPM build cycle
Add missing imports to the header
* Add PrivacyInfo.xcprivacy

* Copy privacy manifest in package
## Summary

Currently, PINRemoteImage does not build with recent build tools. We should fix that, plus update all the dependencies.

This bumps min versions of iOS and tvOS up to 14.0, and macOS to 11.0. This allows us to drop the `libwebp` dependency, which is not currently building with recent tools either, and instead use the system provided decoder. **This does mean tvOS loses support for WebP as tvOS doesn't have a system decoder.**

Also, clean up the headers. Cocoapods was including way too much as public headers, and we were using double quotes instead of angle brackets for them.

## Test plan

Make sure everything builds & unit tests pass. Also, update all the examples and ensure they work.
## Summary

I bumped the version on the podspec prematurely. This causes the Publish Release CI action to fail because _it_ wants to bump the release. But since it's already bumped, the script fails to find the old version.
…rsion-bump

Revert premature version bump
## Summary

We now have some warnings in PINRemoteImage because we still use MD5. It's fine for our use cases, but it means anywhere we use `pod` we have to pass `allow-warnings`. In this case, when publishing the Cocoapod.
…elease

Allow warnings when pod trunk push
## Summary

Recently we made several headers private in Cocoapods. However, some clients were reaching directly into PINRemoteImage's memory cache (PINCache) and pulling out `PINRemoteImageMemoryContainer` and doing whatever with it. To support that use case without exposing more than necessary publicly, introduce the `PINRemoteImageDataConvertible` protocol and have `PINRemoteImageMemoryContainer` conform to it.

So if previously the code was:

```
PINRemoteImageMemoryContainer *container = [[PINRemoteImageManager sharedImageManager].cache objectFromMemoryForKey:imageURL.absoluteString];
NSData *cachedImageDataForURL = [container data];
```
it can be
```
id<PINRemoteImageDataConvertible> container = [[PINRemoteImageManager sharedImageManager].cache objectFromMemoryForKey:imageURL.absoluteString];
NSData *cachedImageDataForURL = [container data];
```

Also, previous changes required `PIN_WEBP` to be defined in the project settings or it would fail to compile. That's been changed to always build. If _not_ specified it will default to `1`.

## Test plan

Run `make all` to run tests and build everything
…-cache-image-data

Expose protocol to get image data from the cache plus WebP cleanup
…updated

# Conflicts:
#	.github/workflows/ci.yaml
#	.github/workflows/publish_release.yml
#	Source/Classes/PINRemoteImageManager.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.