Skip to content

v2.7.2 update #29

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

Merged
merged 2 commits into from
Nov 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,48 @@

## Info

**Document version:** 2.5.0
**Document version:** 2.7.2

**Last updated:** 08/07/2017
**Last updated:** 10/24/2017

**Author:** Nolan O'Brien

## History

### 2.7.2

- improve `TIPImageFetchTransformer` support with optional identifier
- was easy to get the rendered cache images mixed up between transformed and non-transformed fetches
- now, transform requests can only fetch images from the rendered cache if there is a match with the `tip_tranformerIdentifier`
- transformers that don't provide an identifier cannot be cached nor retrieved from the rendered cache
- removed transformer from `TIPGlobalConfiguration` (would interfere with above improvement)

### 2.7.1

- add generic concrete class for `TIPImageFetchRequest` as convenience
- generic fetch request is mutable/immutable pair: `TIPGenericImageFetchRequest` and `TIPMutableGenericImageFetchRequest`

### 2.7.0

- add decoder config support
- enables custom TIPImageDecoder implementations to have configurable ways of being decoded
- add memory map loading option for images
- default continues to not use memory map loading, but it's now exposed on TIPImageContainer
- add MP4 decoder to TIP (as an extended decoder, not bundled by default)
- decodes MP4s as animated images

### 2.6.0

- Remove `TIPImageView`, just use `UIImageView` category instead
- Add `hidden` property support to `UIImageView` fetch helper category
- Remove `TIPImageViewFetchHelper` subclassing event methods
- Use delegate pattern for eventing instead of polymorphism #Simplify
- Remove `setViewHidden:` method for `TIPImageViewFetchHelper`
- It never did what it was advertised to do and muddied the control flow
- Add `fetchResultDimensions` to `TIPImageViewFetchHelper` for more insight into results



### 2.5.0

- Remove detached downloads support for TIP image fetches
Expand Down
60 changes: 60 additions & 0 deletions Extended/TIPXMP4Codec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// TIPXMP4Codec.h
// TwitterImagePipeline
//
// Created by Nolan O'Brien on 3/16/17.
// Copyright © 2017 Twitter. All rights reserved.
//

#import <TwitterImagePipeline/TIPImageCodecs.h>

@protocol TIPXMP4DecoderConfig;

NS_ASSUME_NONNULL_BEGIN

//! Custom image type for MP4 animated images, `@"public.mp4"`
FOUNDATION_EXTERN NSString * const TIPXImageTypeMP4;

/**
Convenience codec for MP4 animation support.
Requires AVFoundation.framework be linked.
This codec is not bundled with __TIP__ to avoid bloating it with MP4 animated image stuff,
but there's nothing preventing a consumer from using this decoder.
@warning this codec (decoder) definitely works, however it loads the entire animation into RAM.
An MP4 animation that is large (in duration and/or pixels) will lead to memory pressure.
Many MP4 animations will lead to memory pressure.
GIF using native iOS decoding does not have this issue as the UIImage has smarts to offload
the memory usage transparently.
To avoid these pressures, a developer should custom implement a similar behavior to what UIImage
does under the hood for GIFs, which is use a ring buffer of decoded images - decoding and cycling
through the buffer as the animation progresses. This is outside the scope of __TIP__ though.
*/
@interface TIPXMP4Codec : NSObject <TIPImageCodec>
/** MP4 decoder */
@property (nonatomic, readonly) id<TIPImageDecoder> tip_decoder;
/** MP4 encoder (`nil` at the moment) */
@property (nonatomic, readonly, nullable) id<TIPImageEncoder> tip_encoder;

/**
designated initializer
@param decoderConfig optional `TIPXMP4DecoderConfig` for default decoding behavior
*/
- (instancetype)initWithDefaultDecoderConfig:(nullable id<TIPXMP4DecoderConfig>)decoderConfig NS_DESIGNATED_INITIALIZER;

/** MP4 decoder default config */
@property(nonatomic, readonly, nullable) id<TIPXMP4DecoderConfig> defaultDecoderConfig;

/** Construct a decoder config */
+ (id<TIPXMP4DecoderConfig>)decoderConfigWithMaxDecodableFramesCount:(NSUInteger)max;

@end

/** config object for decoding behavior */
@protocol TIPXMP4DecoderConfig <NSObject>

/** configure a max number of frames to decode, 0 == unlimited */
@property (nonatomic, readonly) NSUInteger maxDecodableFramesCount;

@end

NS_ASSUME_NONNULL_END
Loading