Skip to content

Commit 7235a39

Browse files
authored
v2.7.2 update (#29)
* Update TIP to v2.7.2 - big update, lots of improvements - see CHANGELOG of 2.6.0 -> 2.7.2 - other bug fixes and optimizations too * v2.7.2 proj cleanup
1 parent 46f87f7 commit 7235a39

File tree

82 files changed

+2091
-856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2091
-856
lines changed

CHANGELOG.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,48 @@
22

33
## Info
44

5-
**Document version:** 2.5.0
5+
**Document version:** 2.7.2
66

7-
**Last updated:** 08/07/2017
7+
**Last updated:** 10/24/2017
88

99
**Author:** Nolan O'Brien
1010

1111
## History
1212

13+
### 2.7.2
14+
15+
- improve `TIPImageFetchTransformer` support with optional identifier
16+
- was easy to get the rendered cache images mixed up between transformed and non-transformed fetches
17+
- now, transform requests can only fetch images from the rendered cache if there is a match with the `tip_tranformerIdentifier`
18+
- transformers that don't provide an identifier cannot be cached nor retrieved from the rendered cache
19+
- removed transformer from `TIPGlobalConfiguration` (would interfere with above improvement)
20+
21+
### 2.7.1
22+
23+
- add generic concrete class for `TIPImageFetchRequest` as convenience
24+
- generic fetch request is mutable/immutable pair: `TIPGenericImageFetchRequest` and `TIPMutableGenericImageFetchRequest`
25+
26+
### 2.7.0
27+
28+
- add decoder config support
29+
- enables custom TIPImageDecoder implementations to have configurable ways of being decoded
30+
- add memory map loading option for images
31+
- default continues to not use memory map loading, but it's now exposed on TIPImageContainer
32+
- add MP4 decoder to TIP (as an extended decoder, not bundled by default)
33+
- decodes MP4s as animated images
34+
35+
### 2.6.0
36+
37+
- Remove `TIPImageView`, just use `UIImageView` category instead
38+
- Add `hidden` property support to `UIImageView` fetch helper category
39+
- Remove `TIPImageViewFetchHelper` subclassing event methods
40+
- Use delegate pattern for eventing instead of polymorphism #Simplify
41+
- Remove `setViewHidden:` method for `TIPImageViewFetchHelper`
42+
- It never did what it was advertised to do and muddied the control flow
43+
- Add `fetchResultDimensions` to `TIPImageViewFetchHelper` for more insight into results
44+
45+
46+
1347
### 2.5.0
1448

1549
- Remove detached downloads support for TIP image fetches

Extended/TIPXMP4Codec.h

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// TIPXMP4Codec.h
3+
// TwitterImagePipeline
4+
//
5+
// Created by Nolan O'Brien on 3/16/17.
6+
// Copyright © 2017 Twitter. All rights reserved.
7+
//
8+
9+
#import <TwitterImagePipeline/TIPImageCodecs.h>
10+
11+
@protocol TIPXMP4DecoderConfig;
12+
13+
NS_ASSUME_NONNULL_BEGIN
14+
15+
//! Custom image type for MP4 animated images, `@"public.mp4"`
16+
FOUNDATION_EXTERN NSString * const TIPXImageTypeMP4;
17+
18+
/**
19+
Convenience codec for MP4 animation support.
20+
Requires AVFoundation.framework be linked.
21+
This codec is not bundled with __TIP__ to avoid bloating it with MP4 animated image stuff,
22+
but there's nothing preventing a consumer from using this decoder.
23+
@warning this codec (decoder) definitely works, however it loads the entire animation into RAM.
24+
An MP4 animation that is large (in duration and/or pixels) will lead to memory pressure.
25+
Many MP4 animations will lead to memory pressure.
26+
GIF using native iOS decoding does not have this issue as the UIImage has smarts to offload
27+
the memory usage transparently.
28+
To avoid these pressures, a developer should custom implement a similar behavior to what UIImage
29+
does under the hood for GIFs, which is use a ring buffer of decoded images - decoding and cycling
30+
through the buffer as the animation progresses. This is outside the scope of __TIP__ though.
31+
*/
32+
@interface TIPXMP4Codec : NSObject <TIPImageCodec>
33+
/** MP4 decoder */
34+
@property (nonatomic, readonly) id<TIPImageDecoder> tip_decoder;
35+
/** MP4 encoder (`nil` at the moment) */
36+
@property (nonatomic, readonly, nullable) id<TIPImageEncoder> tip_encoder;
37+
38+
/**
39+
designated initializer
40+
@param decoderConfig optional `TIPXMP4DecoderConfig` for default decoding behavior
41+
*/
42+
- (instancetype)initWithDefaultDecoderConfig:(nullable id<TIPXMP4DecoderConfig>)decoderConfig NS_DESIGNATED_INITIALIZER;
43+
44+
/** MP4 decoder default config */
45+
@property(nonatomic, readonly, nullable) id<TIPXMP4DecoderConfig> defaultDecoderConfig;
46+
47+
/** Construct a decoder config */
48+
+ (id<TIPXMP4DecoderConfig>)decoderConfigWithMaxDecodableFramesCount:(NSUInteger)max;
49+
50+
@end
51+
52+
/** config object for decoding behavior */
53+
@protocol TIPXMP4DecoderConfig <NSObject>
54+
55+
/** configure a max number of frames to decode, 0 == unlimited */
56+
@property (nonatomic, readonly) NSUInteger maxDecodableFramesCount;
57+
58+
@end
59+
60+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)