Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit f433fe9

Browse files
Merge pull request #341 from wordpress-mobile/release/1.6.0
Release/1.6.0
2 parents f310cc5 + 2fb25e4 commit f433fe9

File tree

10 files changed

+121
-41
lines changed

10 files changed

+121
-41
lines changed

.circleci/config.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
version: 2.1
22

33
orbs:
4-
# This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs
5-
ios: wordpress-mobile/ios@0.0.25
4+
# Using 1.0 of our Orbs means it will use the latest 1.0.x version from https://github.com/wordpress-mobile/circleci-orbs
5+
ios: wordpress-mobile/ios@1.0
66

77
workflows:
88
test_and_validate:
99
jobs:
1010
- ios/test:
1111
name: Test
12-
xcode-version: "10.2.0"
12+
xcode-version: "11.0"
1313
cocoapods-working-directory: Example
1414
workspace: Example/WPMediaPicker.xcworkspace
1515
scheme: WPMediaPicker-Example
16-
device: iPhone XS
17-
ios-version: "12.2"
16+
device: iPhone 11
17+
ios-version: "13.0"
18+
bundle-install: true
19+
pod-install: true
1820
- ios/validate-podspec:
1921
name: Validate Podspec
20-
xcode-version: "10.2.0"
22+
xcode-version: "11.0"
2123
podspec-path: WPMediaPicker.podspec
24+
bundle-install: true
25+
- ios/publish-podspec:
26+
name: Publish to Trunk
27+
xcode-version: "11.0"
28+
podspec-path: WPMediaPicker.podspec
29+
bundle-install: true
30+
post-to-slack: true
31+
filters:
32+
tags:
33+
only: /.*/
34+
branches:
35+
ignore: /.*/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
33
`WPMediaPicker` adheres to [Semantic Versioning](http://semver.org/).
44

55
#### Releases
6+
- `1.6.0` Release - [1.5](#1.6.0)
67
- `1.5.0` Release - [1.5](#1.5.0)
78
- `1.4.2` Release - [1.4](#1.4.2)
89
- `1.4` Release - [1.4](#1.4)
@@ -26,6 +27,13 @@ All notable changes to this project will be documented in this file.
2627
- `0.16` Releases - [0.16](#16)
2728
- `0.15` Releases - [0.15](#15)
2829

30+
---
31+
## [1.6.0](https://github.com/wordpress-mobile/MediaPicker-iOS/releases/tag/1.6.0)
32+
Released on 2019-10-18. All issues associated with this milestone can be found using this [filter](https://github.com/wordpress-mobile/MediaPicker-iOS/pulls?utf8=✓&q=is%3Apr%20is%3Aclosed%20milestone%3A1.6.0).
33+
34+
### Changes
35+
- Fix image/photo capture when it's done with the device rotated. #337 #338
36+
2937
---
3038
## [1.5.0](https://github.com/wordpress-mobile/MediaPicker-iOS/releases/tag/1.5.0)
3139
Released on 2019-09-09. All issues associated with this milestone can be found using this [filter](https://github.com/wordpress-mobile/MediaPicker-iOS/pulls?utf8=✓&q=is%3Apr%20is%3Aclosed%20milestone%3A1.5.0).

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source 'https://github.com/CocoaPods/Specs.git'
1+
source 'https://cdn.cocoapods.org/'
22
platform :ios, '11.0'
33
target 'WPMediaPicker' do
44
pod "WPMediaPicker", :path => "../"

Example/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- WPMediaPicker (1.5.0)
2+
- WPMediaPicker (1.6.0)
33

44
DEPENDENCIES:
55
- WPMediaPicker (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
WPMediaPicker: 3f03b6deeb4d2360679b65c3b33d5c470c822bce
12+
WPMediaPicker: e5d28197da6b467d4e5975d64a49255977e39455
1313

14-
PODFILE CHECKSUM: 02a24c94627582ae16b486b76dc047a7f773dcc4
14+
PODFILE CHECKSUM: 6b0e391139d3864c72fde997a1418dbfe9bf5126
1515

16-
COCOAPODS: 1.6.1
16+
COCOAPODS: 1.8.4

Example/Tests/WPDateTimeHelpersTests.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,43 @@ - (void)testStringFromTimeInterval
2626
{
2727
NSTimeInterval timeInterval = 120;
2828
NSString * result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
29-
XCTAssertEqualObjects(@"2:00", result);
29+
XCTAssertEqualObjects(@"02:00", result);
3030

3131
timeInterval = 119.4;
3232
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
33-
XCTAssertEqualObjects(@"2:00", result);
33+
XCTAssertEqualObjects(@"02:00", result);
3434

3535
timeInterval = 119.5;
3636
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
37-
XCTAssertEqualObjects(@"2:00", result);
37+
XCTAssertEqualObjects(@"02:00", result);
3838

3939
timeInterval = 0.1;
4040
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
41-
XCTAssertEqualObjects(@"0:01", result);
41+
XCTAssertEqualObjects(@"00:01", result);
4242

4343
timeInterval = 30;
4444
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
45-
XCTAssertEqualObjects(@"0:30", result);
45+
XCTAssertEqualObjects(@"00:30", result);
4646

4747
timeInterval = 60;
4848
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
49-
XCTAssertEqualObjects(@"1:00", result);
49+
XCTAssertEqualObjects(@"01:00", result);
5050

5151
timeInterval = 65;
5252
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
53-
XCTAssertEqualObjects(@"1:05", result);
53+
XCTAssertEqualObjects(@"01:05", result);
5454

5555
timeInterval = 3600;
5656
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
57-
XCTAssertEqualObjects(@"1:00:00", result);
57+
XCTAssertEqualObjects(@"01:00:00", result);
5858

5959
timeInterval = 3605;
6060
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
61-
XCTAssertEqualObjects(@"1:00:05", result);
61+
XCTAssertEqualObjects(@"01:00:05", result);
6262

6363
timeInterval = 3667;
6464
result = [WPDateTimeHelpers stringFromTimeInterval:timeInterval];
65-
XCTAssertEqualObjects(@"1:01:07", result);
65+
XCTAssertEqualObjects(@"01:01:07", result);
6666
}
6767

6868
- (void)testUserFriendlyStringDateFromDate {

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source 'https://rubygems.org' do
2-
gem 'cocoapods', '1.6.1'
2+
gem 'cocoapods', '~> 1.8.0'
33
end

Gemfile.lock

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.0)
4+
CFPropertyList (3.0.1)
55
activesupport (4.2.11.1)
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
10+
algoliasearch (1.27.1)
11+
httpclient (~> 2.8, >= 2.8.3)
12+
json (>= 1.5.1)
1013
atomos (0.1.3)
11-
claide (1.0.2)
12-
cocoapods (1.6.1)
14+
claide (1.0.3)
15+
cocoapods (1.8.4)
1316
activesupport (>= 4.0.2, < 5)
1417
claide (>= 1.0.2, < 2.0)
15-
cocoapods-core (= 1.6.1)
16-
cocoapods-deintegrate (>= 1.0.2, < 2.0)
18+
cocoapods-core (= 1.8.4)
19+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
1720
cocoapods-downloader (>= 1.2.2, < 2.0)
1821
cocoapods-plugins (>= 1.0.0, < 2.0)
1922
cocoapods-search (>= 1.0.0, < 2.0)
2023
cocoapods-stats (>= 1.0.0, < 2.0)
21-
cocoapods-trunk (>= 1.3.1, < 2.0)
24+
cocoapods-trunk (>= 1.4.0, < 2.0)
2225
cocoapods-try (>= 1.1.0, < 2.0)
2326
colored2 (~> 3.1)
2427
escape (~> 0.0.4)
25-
fourflusher (>= 2.2.0, < 3.0)
28+
fourflusher (>= 2.3.0, < 3.0)
2629
gh_inspector (~> 1.0)
2730
molinillo (~> 0.6.6)
2831
nap (~> 1.0)
2932
ruby-macho (~> 1.4)
30-
xcodeproj (>= 1.8.1, < 2.0)
31-
cocoapods-core (1.6.1)
33+
xcodeproj (>= 1.11.1, < 2.0)
34+
cocoapods-core (1.8.4)
3235
activesupport (>= 4.0.2, < 6)
36+
algoliasearch (~> 1.0)
37+
concurrent-ruby (~> 1.1)
3338
fuzzy_match (~> 2.0.4)
3439
nap (~> 1.0)
3540
cocoapods-deintegrate (1.0.4)
@@ -38,19 +43,21 @@ GEM
3843
nap
3944
cocoapods-search (1.0.0)
4045
cocoapods-stats (1.1.0)
41-
cocoapods-trunk (1.3.1)
46+
cocoapods-trunk (1.4.1)
4247
nap (>= 0.8, < 2.0)
4348
netrc (~> 0.11)
4449
cocoapods-try (1.1.0)
4550
colored2 (3.1.2)
4651
concurrent-ruby (1.1.5)
4752
escape (0.0.4)
48-
fourflusher (2.2.0)
53+
fourflusher (2.3.1)
4954
fuzzy_match (2.0.4)
5055
gh_inspector (1.1.3)
56+
httpclient (2.8.3)
5157
i18n (0.9.5)
5258
concurrent-ruby (~> 1.0)
53-
minitest (5.11.3)
59+
json (2.2.0)
60+
minitest (5.12.2)
5461
molinillo (0.6.6)
5562
nanaimo (0.2.6)
5663
nap (1.1.0)
@@ -59,7 +66,7 @@ GEM
5966
thread_safe (0.3.6)
6067
tzinfo (1.2.5)
6168
thread_safe (~> 0.1)
62-
xcodeproj (1.8.2)
69+
xcodeproj (1.13.0)
6370
CFPropertyList (>= 2.3.3, < 4.0)
6471
atomos (~> 0.1.3)
6572
claide (>= 1.0.2, < 2.0)
@@ -70,7 +77,7 @@ PLATFORMS
7077
ruby
7178

7279
DEPENDENCIES
73-
cocoapods (= 1.6.1)!
80+
cocoapods (~> 1.8.0)!
7481

7582
BUNDLED WITH
76-
1.17.2
83+
2.0.2

Pod/Classes/WPImageExporter.m

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
@import MobileCoreServices;
44
@import ImageIO;
55

6-
76
@implementation WPImageExporter
87

98
+ (NSURL *)temporaryFileURLWithExtension:(NSString *)fileExtension
@@ -16,18 +15,50 @@ + (NSURL *)temporaryFileURLWithExtension:(NSString *)fileExtension
1615

1716
+ (BOOL)writeImage:(UIImage *)image withMetadata:(NSDictionary *)metadata toURL:(NSURL *)fileURL;
1817
{
19-
NSMutableDictionary *properties = [[NSMutableDictionary alloc] initWithDictionary:@{ (NSString *)kCGImageDestinationLossyCompressionQuality: @(0.9)}];
18+
NSMutableDictionary *properties = [[NSMutableDictionary alloc] initWithDictionary:@{ (NSString *)kCGImageDestinationLossyCompressionQuality: @(0.9) }];
19+
20+
NSMutableDictionary *adjustedMetadata = [[NSMutableDictionary alloc] initWithDictionary:metadata];
21+
NSNumber *adjustedOrientation = @([self CGImagePropertyOrientationForUIImageOrientation: image.imageOrientation]);
22+
adjustedMetadata[(NSString *)kCGImagePropertyOrientation] = adjustedOrientation;
23+
24+
if (adjustedMetadata[(NSString *)kCGImagePropertyTIFFDictionary] != nil) {
25+
NSMutableDictionary *adjustedTIFF = [[NSMutableDictionary alloc] initWithDictionary:adjustedMetadata[(NSString *)kCGImagePropertyTIFFDictionary]];
26+
adjustedTIFF[(NSString *)kCGImagePropertyTIFFOrientation] = adjustedOrientation;
27+
adjustedMetadata[(NSString *)kCGImagePropertyTIFFDictionary] = adjustedTIFF;
28+
}
29+
30+
if (adjustedMetadata[(NSString *)kCGImagePropertyIPTCDictionary] != nil) {
31+
NSMutableDictionary *adjustedIPTC = [[NSMutableDictionary alloc] initWithDictionary:adjustedMetadata[(NSString *)kCGImagePropertyIPTCDictionary]];
32+
adjustedIPTC[(NSString *)kCGImagePropertyIPTCImageOrientation] = adjustedOrientation;
33+
adjustedMetadata[(NSString *)kCGImagePropertyIPTCDictionary] = adjustedIPTC;
34+
}
35+
2036
CGImageDestinationRef destination = CGImageDestinationCreateWithURL((CFURLRef)fileURL, kUTTypeJPEG, 1, nil);
2137
if (destination == NULL) {
2238
return NO;
2339
}
2440
CGImageRef imageRef = image.CGImage;
41+
2542
CGImageDestinationSetProperties(destination, (CFDictionaryRef)properties);
26-
CGImageDestinationAddImage(destination, imageRef, (CFDictionaryRef)metadata);
43+
CGImageDestinationAddImage(destination, imageRef, (CFDictionaryRef)adjustedMetadata);
44+
2745
BOOL result = CGImageDestinationFinalize(destination);
2846

2947
CFRelease(destination);
3048
return result;
3149
}
3250

51+
+ (CGImagePropertyOrientation) CGImagePropertyOrientationForUIImageOrientation:(UIImageOrientation) uiOrientation {
52+
switch (uiOrientation) {
53+
case UIImageOrientationUp: return kCGImagePropertyOrientationUp;
54+
case UIImageOrientationDown: return kCGImagePropertyOrientationDown;
55+
case UIImageOrientationLeft: return kCGImagePropertyOrientationLeft;
56+
case UIImageOrientationRight: return kCGImagePropertyOrientationRight;
57+
case UIImageOrientationUpMirrored: return kCGImagePropertyOrientationUpMirrored;
58+
case UIImageOrientationDownMirrored: return kCGImagePropertyOrientationDownMirrored;
59+
case UIImageOrientationLeftMirrored: return kCGImagePropertyOrientationLeftMirrored;
60+
case UIImageOrientationRightMirrored: return kCGImagePropertyOrientationRightMirrored;
61+
}
62+
}
63+
3364
@end

WPMediaPicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WPMediaPicker"
3-
s.version = "1.5.0"
3+
s.version = "1.6.0"
44
s.summary = "WPMediaPicker is an iOS controller that allows capture and picking of media assets."
55
s.description = <<-DESC
66
WPMediaPicker is an iOS controller that allows capture and picking of media assets.

0 commit comments

Comments
 (0)