diff --git a/wire-ios-data-model/Tests/Source/Model/Messages/ZMAssetClientMessageTests.swift b/wire-ios-data-model/Tests/Source/Model/Messages/ZMAssetClientMessageTests.swift index d0b3bd909a4..409dc95a1b8 100644 --- a/wire-ios-data-model/Tests/Source/Model/Messages/ZMAssetClientMessageTests.swift +++ b/wire-ios-data-model/Tests/Source/Model/Messages/ZMAssetClientMessageTests.swift @@ -61,7 +61,7 @@ class BaseZMAssetClientMessageTests: BaseZMClientMessageTests { message = try conversation.appendImage(from: imageData, nonce: messageNonce) as? ZMAssetClientMessage let imageSize = ZMImagePreprocessor.sizeOfPrerotatedImage(with: imageData) - let properties = ZMIImageProperties(size: imageSize, length: UInt(imageData.count), mimeType: "image/jpeg")! + let properties = ZMIImageProperties(size: imageSize, length: UInt(imageData.count), mimeType: "image/jpeg") let keys = ZMImageAssetEncryptionKeys( otrKey: Data.randomEncryptionKey(), @@ -912,7 +912,7 @@ extension ZMAssetClientMessageTests { size: CGSize(width: CGFloat(300 * mult), height: CGFloat(100 * mult)), length: UInt(100 * mult), mimeType: "image/jpeg" - )! + ) } func createV2AssetClientMessageWithSampleImageAndEncryptionKeys( diff --git a/wire-ios-data-model/Tests/Source/Model/Utils/ProtosTests.swift b/wire-ios-data-model/Tests/Source/Model/Utils/ProtosTests.swift index ba1818d7e5f..ff303919bef 100644 --- a/wire-ios-data-model/Tests/Source/Model/Utils/ProtosTests.swift +++ b/wire-ios-data-model/Tests/Source/Model/Utils/ProtosTests.swift @@ -59,12 +59,12 @@ class ProtosTests: XCTestCase { size: CGSize(width: 10_000, height: 20_000), length: 200_000, mimeType: "fancy image" - )! + ) let processedProperties = ZMIImageProperties( size: CGSize(width: 640, height: 480), length: 200, mimeType: "downsized image" - )! + ) // when let message = GenericMessage( @@ -103,12 +103,12 @@ class ProtosTests: XCTestCase { size: CGSize(width: 10_000, height: 20_000), length: 200_000, mimeType: "fancy image" - )! + ) let processedProperties = ZMIImageProperties( size: CGSize(width: 640, height: 480), length: 200, mimeType: "downsized image" - )! + ) _ = ZMImageAssetEncryptionKeys(otrKey: otrKey, macKey: macKey, mac: mac) let format = ZMImageFormat.preview let keys = ZMImageAssetEncryptionKeys(otrKey: otrKey, macKey: macKey, mac: mac) diff --git a/wire-ios-images/Sources/Image Processing/ImageProperties.swift b/wire-ios-images/Sources/Image Processing/ImageProperties.swift new file mode 100644 index 00000000000..fc983de6bc8 --- /dev/null +++ b/wire-ios-images/Sources/Image Processing/ImageProperties.swift @@ -0,0 +1,37 @@ +// +// Wire +// Copyright (C) 2025 Wire Swiss GmbH +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +import CoreGraphics +import Foundation + +@objcMembers +public class ZMIImageProperties: NSObject { + public let size: CGSize + public let length: UInt + public let mimeType: String + + public init(size: CGSize, length: UInt, mimeType: String) { + self.size = size + self.length = length + self.mimeType = mimeType + } + + public override var description: String { + "{ length: \(length), type: \(mimeType), size: (\(size.width), \(size.height)}" + } +} diff --git a/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.h b/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.h index bd94e50436b..383138d7525 100644 --- a/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.h +++ b/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.h @@ -22,6 +22,7 @@ #import @protocol ZMAssetsPreprocessorDelegate; +@protocol ZMImageOwner; @protocol ZMAssetsPreprocessor diff --git a/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.m b/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.m index 7d1f52b900c..f93c2fbdcda 100644 --- a/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.m +++ b/wire-ios-images/Sources/Image Processing/ZMAssetsPreprocessor.m @@ -22,7 +22,7 @@ #import "ZMImageLoadOperation.h" #import "ZMImageOwner.h" #import "ZMImageDownsampleOperation.h" - +#import @implementation ZMAssetsPreprocessor diff --git a/wire-ios-images/Sources/Image Processing/ZMIImageProperties.m b/wire-ios-images/Sources/Image Processing/ZMIImageProperties.m deleted file mode 100644 index 7ca90af62d2..00000000000 --- a/wire-ios-images/Sources/Image Processing/ZMIImageProperties.m +++ /dev/null @@ -1,44 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -#import "ZMIImageProperties.h" - -@interface ZMIImageProperties () - -@property (nonatomic) CGSize size; -@property (nonatomic) NSUInteger length; -@property (nonatomic, copy) NSString *mimeType; - -@end - -@implementation ZMIImageProperties - -+ (instancetype)imagePropertiesWithSize:(CGSize)size length:(NSUInteger)length mimeType:(NSString *)type -{ - ZMIImageProperties *properties = [[ZMIImageProperties alloc] init]; - properties.length = length; - properties.size = size; - properties.mimeType = type; - return properties; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"{ length: %lu, type: %@, size:(%f , %f)}", (unsigned long)self.length, self.mimeType, self.size.width, self.size.height]; -} - -@end diff --git a/wire-ios-images/Sources/Image Processing/ZMImageDownsampleOperation.h b/wire-ios-images/Sources/Image Processing/ZMImageDownsampleOperation.h index c9f0f5c91dd..cb4775c5a3b 100644 --- a/wire-ios-images/Sources/Image Processing/ZMImageDownsampleOperation.h +++ b/wire-ios-images/Sources/Image Processing/ZMImageDownsampleOperation.h @@ -19,9 +19,9 @@ @import Foundation; #import -#import @class ZMImageLoadOperation; +@class ZMIImageProperties; typedef NS_ENUM (int16_t, ZMImageDownsampleType) { diff --git a/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.h b/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.h index 4b2888456f8..138ebd1ca4b 100644 --- a/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.h +++ b/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.h @@ -19,7 +19,7 @@ @import Foundation; @import CoreGraphics; -#import +@class ZMIImageProperties; @interface ZMImageLoadOperation : NSOperation diff --git a/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.m b/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.m index 38f021167eb..e2fa90e552b 100644 --- a/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.m +++ b/wire-ios-images/Sources/Image Processing/ZMImageLoadOperation.m @@ -21,7 +21,7 @@ @import WireSystem; #import "ZMImageLoadOperation.h" - +#import @interface ZMImageLoadOperation () { @@ -108,11 +108,7 @@ - (void)main; CGSize size = [self imageSizeFromSourceImage]; NSUInteger length = (NSUInteger) [(NSNumber *)self.sourceImageProperties[(__bridge id) kCGImagePropertyFileSize] intValue]; NSString *mimeType = (__bridge id) CGImageSourceGetType(_source); - self.computedImageProperties = [ZMIImageProperties - imagePropertiesWithSize:size - length:length - mimeType:mimeType - ]; + self.computedImageProperties = [[ZMIImageProperties alloc] initWithSize:size length:length mimeType:mimeType]; } - (int)tiffOrientation; diff --git a/wire-ios-images/Sources/Image Processing/ZMImageOwner.h b/wire-ios-images/Sources/Image Processing/ZMImageOwner.h index dbee699cdea..2e25d5ed000 100644 --- a/wire-ios-images/Sources/Image Processing/ZMImageOwner.h +++ b/wire-ios-images/Sources/Image Processing/ZMImageOwner.h @@ -18,7 +18,6 @@ @import Foundation; @import CoreGraphics; -#import "ZMIImageProperties.h" typedef NS_ENUM(NSUInteger, ZMImageFormat) { ZMImageFormatInvalid = 0, @@ -27,13 +26,3 @@ typedef NS_ENUM(NSUInteger, ZMImageFormat) { ZMImageFormatOriginal, ZMImageFormatProfile }; - -@protocol ZMImageOwner - -/// The image formats that this @c ZMImageOwner wants preprocessed. Order of formats determines order in which data is preprocessed -- (nonnull NSOrderedSet *)requiredImageFormats; - -- (nullable NSData *)originalImageData; - -@end - diff --git a/wire-ios-images/Sources/Image Processing/ZMIImageProperties.h b/wire-ios-images/Sources/Image Processing/ZMImageOwner.swift similarity index 66% rename from wire-ios-images/Sources/Image Processing/ZMIImageProperties.h rename to wire-ios-images/Sources/Image Processing/ZMImageOwner.swift index 2e8736791fd..32872e3597f 100644 --- a/wire-ios-images/Sources/Image Processing/ZMIImageProperties.h +++ b/wire-ios-images/Sources/Image Processing/ZMImageOwner.swift @@ -16,15 +16,18 @@ // along with this program. If not, see http://www.gnu.org/licenses/. // -@import CoreGraphics; -@import Foundation; +import Foundation -@interface ZMIImageProperties : NSObject +@objc +public protocol ZMImageOwner: NSObjectProtocol { -@property (nonatomic, readonly) CGSize size; -@property (nonatomic, readonly) NSUInteger length; -@property (nonatomic, readonly, copy) NSString *mimeType; + /// The image formats that this ``ZMImageOwner`` wants preprocessed. Order of formats determines order in which data + /// is preprocessed -+ (instancetype)imagePropertiesWithSize:(CGSize)size length:(NSUInteger)length mimeType:(NSString *)type; + @objc + func requiredImageFormats() -> NSOrderedSet -@end + @objc + func originalImageData() -> Data? + +} diff --git a/wire-ios-images/Sources/WireImages.h b/wire-ios-images/Sources/WireImages.h index 7d55d373fe3..bddcc98aaad 100644 --- a/wire-ios-images/Sources/WireImages.h +++ b/wire-ios-images/Sources/WireImages.h @@ -32,4 +32,3 @@ FOUNDATION_EXPORT const unsigned char WireImagesVersionString[]; #import #import #import -#import diff --git a/wire-ios-images/Tests/ImageLoadOperationTests.swift b/wire-ios-images/Tests/ImageLoadOperationTests.swift new file mode 100644 index 00000000000..342d88eae29 --- /dev/null +++ b/wire-ios-images/Tests/ImageLoadOperationTests.swift @@ -0,0 +1,79 @@ +// +// Wire +// Copyright (C) 2025 Wire Swiss GmbH +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +import UniformTypeIdentifiers +import WireTesting +import XCTest + +@testable import WireImages + +final class ImageLoadOperationTests: ZMTBaseTest { + + func testThatItLoadsJPEGData() throws { + // given + let imageData = try XCTUnwrap(data(forResource: "unsplash_medium_exif_2", extension: "jpg")) + let sut = try XCTUnwrap(ZMImageLoadOperation(imageData: imageData)) + expectation(for: NSPredicate(format: "isFinished == YES"), evaluatedWith: sut, handler: nil) + + // when + sut.start() + waitForExpectations(timeout: 5) + + // then + let tiffDictionary = try XCTUnwrap( + sut.sourceImageProperties[kCGImagePropertyTIFFDictionary] as? [AnyHashable: Any] + ) + XCTAssertNotNil(sut.cgImage) + XCTAssertEqual(tiffDictionary[kCGImagePropertyTIFFOrientation] as? Int, 2) + XCTAssertEqual(sut.sourceImageProperties[kCGImagePropertyOrientation] as? Int, 2) + XCTAssertEqual(sut.sourceImageProperties[kCGImagePropertyPixelHeight] as? Double, 346) + XCTAssertEqual(sut.sourceImageProperties[kCGImagePropertyPixelWidth] as? Double, 531) + XCTAssertEqual(sut.originalImageData, imageData) + XCTAssertEqual(sut.computedImageProperties.mimeType, UTType.jpeg.identifier) + XCTAssertEqual(sut.tiffOrientation, 2) + XCTAssertEqual(sut.computedImageProperties.size, CGSize(width: 531, height: 346)) + } + + func testThatItDoesNotLoadWhenCancelled() throws { + // given + let imageData = try XCTUnwrap(data(forResource: "unsplash_medium", extension: "jpg")) + let sut = try XCTUnwrap(ZMImageLoadOperation(imageData: imageData)) + sut.cancel() + expectation(for: NSPredicate(format: "isFinished == YES"), evaluatedWith: sut, handler: nil) + + // when + sut.start() + waitForExpectations(timeout: 5) + + // then + XCTAssertNil(sut.cgImage) + XCTAssertNil(sut.sourceImageProperties) + } + + func testThatItDoesNotCrashOnInvalidData() throws { + // given + let imageData = try XCTUnwrap(data(forResource: "Lorem Ipsum", extension: "txt")) + let sut = try XCTUnwrap(ZMImageLoadOperation(imageData: imageData)) + expectation(for: NSPredicate(format: "isFinished == YES"), evaluatedWith: sut, handler: nil) + + // when + sut.start() + waitForExpectations(timeout: 5) + } + +} diff --git a/wire-ios-images/Tests/ImagePreprocessorTests.swift b/wire-ios-images/Tests/ImagePreprocessorTests.swift new file mode 100644 index 00000000000..cf244e524f3 --- /dev/null +++ b/wire-ios-images/Tests/ImagePreprocessorTests.swift @@ -0,0 +1,139 @@ +// +// Wire +// Copyright (C) 2025 Wire Swiss GmbH +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +import WireTesting +import XCTest + +@testable import WireImages + +final class ImagePreprocessorTests: ZMTBaseTest { + + private var processingQueue: OperationQueue! + + override func setUp() { + super.setUp() + + processingQueue = OperationQueue() + processingQueue.name = "\(name).processingQueue" + + } + + override func tearDown() { + processingQueue = nil + + super.tearDown() + } + + func testThatItCanCalculateTheSizeOfAnImage() { + let imageURL = fileURL(forResource: "unsplash_medium", extension: "jpg") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL), CGSize(width: 531, height: 346)) + } + + func testThatItReturnsZeroSizeIfFileIsNotAnImage() { + let imageURL = fileURL(forResource: "Lorem Ipsum", extension: "txt") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL), CGSize.zero) + } + + func testThatItReturnsTheRotatedSizeForImagesWithATIFFOrientation() { + let imageURL = fileURL(forResource: "unsplash_medium_exif_3", extension: "jpg") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL), CGSize(width: 531, height: 346)) + + let imageURL2 = fileURL(forResource: "unsplash_medium_exif_6", extension: "jpg") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL2), CGSize(width: 531, height: 346)) + + let imageURL3 = fileURL(forResource: "unsplash_medium_exif_8", extension: "jpg") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL3), CGSize(width: 531, height: 346)) + } + + func testThatItReturnsTheRotatedSizeForImagesWithTIFFOrientation5() { + let properties: [String: Any] = [ + "ColorModel": "RGB", + "DPIHeight": 72, + "DPIWidth": 72, + "Depth": 8, + "Orientation": 5, + "PixelHeight": 600, + "PixelWidth": 450, + "ProfileName": "Generic RGB Profile", + "{Exif}": [ + "PixelXDimension": 450, + "PixelYDimension": 600 + ], + "{JFIF}": [ + "DensityUnit": 1, + "JFIFVersion": [1, 0, 1], + "XDensity": 72, + "YDensity": 72 + ], + "{TIFF}": [ + "Orientation": 5, + "ResolutionUnit": 2, + "XResolution": 72, + "YResolution": 72 + ] + ] + let expected = CGSize(width: 600, height: 450) + XCTAssertEqual(ZMImagePreprocessor.imageSize(fromProperties: properties), expected) + } + + func testThatItReturnsTheRotatedSizeForImagesWithTIFFOrientation7() { + let properties: [String: Any] = [ + "ColorModel": "RGB", + "DPIHeight": 72, + "DPIWidth": 72, + "Depth": 8, + "Orientation": 7, + "PixelHeight": 450, + "PixelWidth": 600, + "ProfileName": "Generic RGB Profile", + "{Exif}": [ + "PixelXDimension": 600, + "PixelYDimension": 450 + ], + "{JFIF}": [ + "DensityUnit": 1, + "JFIFVersion": [1, 0, 1], + "XDensity": 72, + "YDensity": 72 + ], + "{TIFF}": [ + "Orientation": 7, + "ResolutionUnit": 2, + "XResolution": 72, + "YResolution": 72 + ] + ] + let expected = CGSize(width: 450, height: 600) + XCTAssertEqual(ZMImagePreprocessor.imageSize(fromProperties: properties), expected) + } + + func testThatItReturnsZeroSizeIfFileDoesNotExist() { + let imageURL = URL(fileURLWithPath: "/foo/bar") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(at: imageURL), CGSize.zero) + } + + func testThatItCanCalculateTheSizeOfAnImageFromData() { + let imageData = data(forResource: "unsplash_medium", extension: "jpg") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(with: imageData), CGSize(width: 531, height: 346)) + } + + func testThatItReturnsZeroSizeIfDataIsNotAnImage() { + let imageData = data(forResource: "Lorem Ipsum", extension: "txt") + XCTAssertEqual(ZMImagePreprocessor.sizeOfPrerotatedImage(with: imageData), CGSize.zero) + } +} diff --git a/wire-ios-images/Tests/NSOperationQueue+Helpers.m b/wire-ios-images/Tests/NSOperationQueue+Helpers.m deleted file mode 100644 index 4625edd40aa..00000000000 --- a/wire-ios-images/Tests/NSOperationQueue+Helpers.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -@import WireTesting; -#import "NSOperationQueue+Helpers.h" - -@implementation NSOperationQueue (Helpers) - -+ (instancetype)serialQueueWithName:(NSString *)name; -{ - NSOperationQueue *queue = [[self alloc] init]; - queue.maxConcurrentOperationCount = 1; - queue.name = name; - return queue; -} - -- (void)waitUntilAllOperationsAreFinishedWithTimeout:(NSTimeInterval)timeout; -{ - timeout = [ZMTBaseTest timeToUseForOriginalTime:timeout]; - dispatch_semaphore_t sem = dispatch_semaphore_create(0); - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - [self waitUntilAllOperationsAreFinished]; - dispatch_semaphore_signal(sem); - }); - dispatch_time_t t = dispatch_walltime(DISPATCH_TIME_NOW, llround(timeout * NSEC_PER_SEC)); - if (dispatch_semaphore_wait(sem, t) != 0) { - NSLog(@"Timed out while waiting for queue \"%@\". Call stack:\n%@", - self.name, [NSThread callStackSymbols]); - exit(-1); - } -} - -@end diff --git a/wire-ios-images/Tests/NSOperationQueue+Helpers.h b/wire-ios-images/Tests/OperationQueue+Helpers.swift similarity index 73% rename from wire-ios-images/Tests/NSOperationQueue+Helpers.h rename to wire-ios-images/Tests/OperationQueue+Helpers.swift index 264d353b184..48477cfa2c1 100644 --- a/wire-ios-images/Tests/NSOperationQueue+Helpers.h +++ b/wire-ios-images/Tests/OperationQueue+Helpers.swift @@ -16,11 +16,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/. // -#import +import Foundation -@interface NSOperationQueue (Helpers) +extension OperationQueue { -+ (instancetype)serialQueueWithName:(NSString *)name; -- (void)waitUntilAllOperationsAreFinishedWithTimeout:(NSTimeInterval)timeout; + @objc + static func serialQueue(name: String) -> OperationQueue { + let queue = OperationQueue() + queue.maxConcurrentOperationCount = 1 + queue.name = name + return queue + } -@end +} diff --git a/wire-ios-images/Tests/ZMImageDownsampleOperationTests.m b/wire-ios-images/Tests/ZMImageDownsampleOperationTests.m index 6411f864bdc..4e623f46c0c 100644 --- a/wire-ios-images/Tests/ZMImageDownsampleOperationTests.m +++ b/wire-ios-images/Tests/ZMImageDownsampleOperationTests.m @@ -19,8 +19,6 @@ @import WireImages; @import WireTesting; -#import "NSOperationQueue+Helpers.h" - static NSString const * TypeJPEG = @"image/jpeg"; @interface ZMImageDownsampleOperationTests : ZMTBaseTest diff --git a/wire-ios-images/Tests/ZMImageLoadOperationTests.m b/wire-ios-images/Tests/ZMImageLoadOperationTests.m deleted file mode 100644 index d326f53467f..00000000000 --- a/wire-ios-images/Tests/ZMImageLoadOperationTests.m +++ /dev/null @@ -1,97 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -@import ImageIO; - -#if TARGET_OS_IPHONE -@import MobileCoreServices; -#endif - -@import WireImages; -@import WireTesting; -@import UniformTypeIdentifiers; - - -@interface ZMImageLoadOperationTests : ZMTBaseTest -@end - - - -@implementation ZMImageLoadOperationTests - -- (void)testThatItLoadsJPEGData; -{ - // given - NSData *imageData = [self dataForResource:@"unsplash_medium_exif_2" extension:@"jpg"]; - ZMImageLoadOperation *sut = [[ZMImageLoadOperation alloc] initWithImageData:imageData]; - - // when - [sut start]; - XCTAssert([self waitOnMainLoopUntilBlock:^BOOL{ - return [sut isFinished]; - } timeout:1]); - - // then - XCTAssertNotNil(sut); - XCTAssertNotEqual(sut.CGImage, NULL); - XCTAssertEqualObjects(sut.sourceImageProperties[(__bridge id) kCGImagePropertyTIFFDictionary][(__bridge id) kCGImagePropertyTIFFOrientation], @2); - XCTAssertEqualObjects(sut.sourceImageProperties[(__bridge id) kCGImagePropertyOrientation], @2); - XCTAssertEqualObjects(sut.sourceImageProperties[(__bridge id) kCGImagePropertyPixelHeight], @346); - XCTAssertEqualObjects(sut.sourceImageProperties[(__bridge id) kCGImagePropertyPixelWidth], @531); - AssertEqualData(sut.originalImageData, imageData); - XCTAssertEqualObjects(sut.computedImageProperties.mimeType, UTTypeJPEG.identifier); - XCTAssertEqual(sut.tiffOrientation, 2); - AssertEqualSizes(sut.computedImageProperties.size, CGSizeMake(531, 346)); -} - -- (void)testThatItDoesNotLoadWhenCancelled -{ - // given - NSData *imageData = [self dataForResource:@"unsplash_medium" extension:@"jpg"]; - XCTAssertNotNil(imageData); - ZMImageLoadOperation *sut = [[ZMImageLoadOperation alloc] initWithImageData:imageData]; - [sut cancel]; - - // when - [sut start]; - XCTAssert([self waitOnMainLoopUntilBlock:^BOOL{ - return [sut isFinished]; - } timeout:1]); - - // then - XCTAssertNotNil(sut); - XCTAssertEqual(sut.CGImage, NULL); - XCTAssertNil(sut.sourceImageProperties); -} - -- (void)testThatItDoesNotCrashOnInvalidData -{ - // given - NSData *imageData = [self dataForResource:@"Lorem Ipsum" extension:@"txt"]; - ZMImageLoadOperation *sut = [[ZMImageLoadOperation alloc] initWithImageData:imageData]; - - // when - [sut start]; - XCTAssert([self waitOnMainLoopUntilBlock:^BOOL{ - return [sut isFinished]; - } timeout:1]); - - // then -} - -@end diff --git a/wire-ios-images/Tests/ZMImagePreprocessorTests.m b/wire-ios-images/Tests/ZMImagePreprocessorTests.m deleted file mode 100644 index ec0cfb071a6..00000000000 --- a/wire-ios-images/Tests/ZMImagePreprocessorTests.m +++ /dev/null @@ -1,158 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -@import WireImages; -@import WireTesting; -@import OCMock; - - -@interface ZMImagePreprocessorTests : ZMTBaseTest - -@property (nonatomic) NSOperationQueue *processingQueue; - -@end - - - -@implementation ZMImagePreprocessorTests - -- (void)setUp -{ - [super setUp]; - self.processingQueue = [[NSOperationQueue alloc] init]; - self.processingQueue.name = [NSString stringWithFormat:@"%@.processingQueue", self.name]; -} - -- (void)tearDown -{ - self.processingQueue = nil; - [super tearDown]; -} - -- (void)testThatItCanCalculateTheSizeOfAnImage -{ - NSURL *imageURL = [self fileURLForResource:@"unsplash_medium" extension:@"jpg"]; - AssertEqualSizes([ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL], CGSizeMake(531, 346)); -} - -- (void)testThatItReturnsZeroSizeIfFileIsNotAnImage -{ - NSURL *imageURL = [self fileURLForResource:@"Lorem Ipsum" extension:@"txt"]; - AssertEqualSizes([ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL], CGSizeZero); -} - -- (void)testThatItReturnsTheRotatedSizeForImagesWithATIFFOrientation -{ - NSURL *imageURL; - imageURL = [self fileURLForResource:@"unsplash_medium_exif_3" extension:@"jpg"]; - XCTAssertNotNil(imageURL); - CGSize orientation3Size = [ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL]; - AssertEqualSizes(orientation3Size, CGSizeMake(531, 346)); - imageURL = [self fileURLForResource:@"unsplash_medium_exif_6" extension:@"jpg"]; - XCTAssertNotNil(imageURL); - CGSize orientation6Size = [ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL]; - AssertEqualSizes(orientation6Size, CGSizeMake(531, 346)); - imageURL = [self fileURLForResource:@"unsplash_medium_exif_8" extension:@"jpg"]; - XCTAssertNotNil(imageURL); - CGSize orientation8Size = [ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL]; - AssertEqualSizes(orientation8Size, CGSizeMake(531, 346)); -} - -- (void)testThatItReturnsTheRotatedSizeForImagesWithTIFFOrientation5; -{ - NSDictionary *properties = @{ - @"ColorModel": @"RGB", - @"DPIHeight": @72, - @"DPIWidth": @72, - @"Depth": @8, - @"Orientation": @5, - @"PixelHeight": @600, - @"PixelWidth": @450, - @"ProfileName": @"Generic RGB Profile", - @"{Exif}": @{ - @"PixelXDimension": @450, - @"PixelYDimension": @600, - }, - @"{JFIF}": @{ - @"DensityUnit": @1, - @"JFIFVersion": @[@1, @0, @1], - @"XDensity": @72, - @"YDensity": @72, - }, - @"{TIFF}": @{ - @"Orientation": @5, - @"ResolutionUnit": @2, - @"XResolution": @72, - @"YResolution": @72, - }, - }; - CGSize expected = {600, 450}; - XCTAssertTrue(CGSizeEqualToSize([ZMImagePreprocessor imageSizeFromProperties:properties], expected)); -} - -- (void)testThatItReturnsTheRotatedSizeForImagesWithTIFFOrientation7; -{ - NSDictionary *properties = @{ - @"ColorModel": @"RGB", - @"DPIHeight": @72, - @"DPIWidth": @72, - @"Depth": @8, - @"Orientation": @7, - @"PixelHeight": @450, - @"PixelWidth": @600, - @"ProfileName": @"Generic RGB Profile", - @"{Exif}": @{ - @"PixelXDimension": @600, - @"PixelYDimension": @450, - }, - @"{JFIF}": @{ - @"DensityUnit": @1, - @"JFIFVersion": @[@1, @0, @1], - @"XDensity": @72, - @"YDensity": @72, - }, - @"{TIFF}": @{ - @"Orientation": @7, - @"ResolutionUnit": @2, - @"XResolution": @72, - @"YResolution": @72, - }, - }; - CGSize expected = {450, 600}; - XCTAssertTrue(CGSizeEqualToSize([ZMImagePreprocessor imageSizeFromProperties:properties], expected)); -} - -- (void)testThatItReturnsZeroSizeIfFileDoesNotExist -{ - NSURL *imageURL = [NSURL fileURLWithPath:@"/foo/bar"]; - AssertEqualSizes([ZMImagePreprocessor sizeOfPrerotatedImageAtURL:imageURL], CGSizeZero); -} - -- (void)testThatItCanCalculateTheSizeOfAnImageFromData -{ - NSData *imageData = [self dataForResource:@"unsplash_medium" extension:@"jpg"]; - AssertEqualSizes([ZMImagePreprocessor sizeOfPrerotatedImageWithData:imageData], CGSizeMake(531, 346)); -} - -- (void)testThatItReturnsZeroSizeIfDataIsNotAnImage -{ - NSData *imageData = [self dataForResource:@"Lorem Ipsum" extension:@"txt"]; - AssertEqualSizes([ZMImagePreprocessor sizeOfPrerotatedImageWithData:imageData], CGSizeZero); -} - -@end diff --git a/wire-ios-images/WireImages.xcodeproj/project.pbxproj b/wire-ios-images/WireImages.xcodeproj/project.pbxproj index a790e0f9923..b404af30a5c 100644 --- a/wire-ios-images/WireImages.xcodeproj/project.pbxproj +++ b/wire-ios-images/WireImages.xcodeproj/project.pbxproj @@ -17,13 +17,7 @@ 096960341B663EF0006DF53B /* ZMImagePreprocessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 098CB13A1B5FAD5A00712DF9 /* ZMImagePreprocessor.h */; settings = {ATTRIBUTES = (Public, ); }; }; 096960351B663EF0006DF53B /* ZMImagePreprocessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 098CB13B1B5FAD5A00712DF9 /* ZMImagePreprocessor.m */; }; 096960361B663EFC006DF53B /* WireImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 098CB13C1B5FAD5A00712DF9 /* WireImages.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 09B976CB1B6693D700A30B38 /* ZMImagePreprocessorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B976C91B6693D700A30B38 /* ZMImagePreprocessorTests.m */; }; - 09B977381B669B6C00A30B38 /* ZMImageLoadOperationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B977361B669B6C00A30B38 /* ZMImageLoadOperationTests.m */; }; - 09B977411B669C8E00A30B38 /* ZMImageDownsampleOperationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B9773F1B669C8E00A30B38 /* ZMImageDownsampleOperationTests.m */; }; - 09B977451B669CEC00A30B38 /* NSOperationQueue+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B977431B669CEC00A30B38 /* NSOperationQueue+Helpers.m */; }; 09BCDB591BC664DA0020DCC7 /* ImageOwner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09BCDB581BC664DA0020DCC7 /* ImageOwner.swift */; }; - 5405B0091BCEBDBF00C0C3BD /* ZMIImageProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 5405B0071BCEBDBF00C0C3BD /* ZMIImageProperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5405B00A1BCEBDBF00C0C3BD /* ZMIImageProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 5405B0081BCEBDBF00C0C3BD /* ZMIImageProperties.m */; }; 591B6E712C8B0A0D009F8A7B /* WireUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE98A0B0296EFD2F0055E981 /* WireUtilities.framework */; }; 591B6E742C8B0A10009F8A7B /* WireImages.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0969600C1B663E7B006DF53B /* WireImages.framework */; }; 591B6E772C8B0A17009F8A7B /* WireImages.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0969600C1B663E7B006DF53B /* WireImages.framework */; }; @@ -33,45 +27,12 @@ 870253ED1DAB7AA00095D272 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 870253EB1DAB7AA00095D272 /* Main.storyboard */; }; 870253EF1DAB7AA00095D272 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 870253EE1DAB7AA00095D272 /* Assets.xcassets */; }; 87B91C041E5C586D00A5EC11 /* NSData+MediaMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87B91C031E5C586D00A5EC11 /* NSData+MediaMetadata.swift */; }; - 87B91C061E5C5D8600A5EC11 /* NSDataMetadataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87B91C051E5C5D8600A5EC11 /* NSDataMetadataTests.swift */; }; - 87B91C2C1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C091E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated.jpg */; }; - 87B91C2D1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated_preview.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C0A1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated_preview.jpg */; }; - 87B91C301E5C7E5D00A5EC11 /* ceiling_rotated_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C0D1E5C7E5D00A5EC11 /* ceiling_rotated_2.png */; }; - 87B91C311E5C7E5D00A5EC11 /* ceiling_rotated_3.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C0E1E5C7E5D00A5EC11 /* ceiling_rotated_3.tiff */; }; - 87B91C321E5C7E5D00A5EC11 /* Lorem Ipsum.txt in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C0F1E5C7E5D00A5EC11 /* Lorem Ipsum.txt */; }; - 87B91C331E5C7E5D00A5EC11 /* unsplash_720_KB.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C101E5C7E5D00A5EC11 /* unsplash_720_KB.jpg */; }; - 87B91C341E5C7E5D00A5EC11 /* unsplash_720_KB_preview.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C111E5C7E5D00A5EC11 /* unsplash_720_KB_preview.jpg */; }; - 87B91C351E5C7E5D00A5EC11 /* unsplash_720_KB_rotated.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C121E5C7E5D00A5EC11 /* unsplash_720_KB_rotated.jpg */; }; - 87B91C361E5C7E5D00A5EC11 /* unsplash_720_KB_unrotated.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C131E5C7E5D00A5EC11 /* unsplash_720_KB_unrotated.jpg */; }; - 87B91C371E5C7E5D00A5EC11 /* unsplash_big_gif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C141E5C7E5D00A5EC11 /* unsplash_big_gif.gif */; }; - 87B91C381E5C7E5D00A5EC11 /* unsplash_medium.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C151E5C7E5D00A5EC11 /* unsplash_medium.jpg */; }; - 87B91C391E5C7E5D00A5EC11 /* unsplash_medium_exif_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C161E5C7E5D00A5EC11 /* unsplash_medium_exif_2.jpg */; }; - 87B91C3A1E5C7E5D00A5EC11 /* unsplash_medium_exif_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C171E5C7E5D00A5EC11 /* unsplash_medium_exif_3.jpg */; }; - 87B91C3B1E5C7E5D00A5EC11 /* unsplash_medium_exif_4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C181E5C7E5D00A5EC11 /* unsplash_medium_exif_4.jpg */; }; - 87B91C3C1E5C7E5D00A5EC11 /* unsplash_medium_exif_5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C191E5C7E5D00A5EC11 /* unsplash_medium_exif_5.jpg */; }; - 87B91C3D1E5C7E5D00A5EC11 /* unsplash_medium_exif_6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1A1E5C7E5D00A5EC11 /* unsplash_medium_exif_6.jpg */; }; - 87B91C3E1E5C7E5D00A5EC11 /* unsplash_medium_exif_6_small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1B1E5C7E5D00A5EC11 /* unsplash_medium_exif_6_small.jpg */; }; - 87B91C3F1E5C7E5D00A5EC11 /* unsplash_medium_exif_7.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1C1E5C7E5D00A5EC11 /* unsplash_medium_exif_7.jpg */; }; - 87B91C401E5C7E5D00A5EC11 /* unsplash_medium_exif_8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1D1E5C7E5D00A5EC11 /* unsplash_medium_exif_8.jpg */; }; - 87B91C411E5C7E5D00A5EC11 /* unsplash_medium_small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1E1E5C7E5D00A5EC11 /* unsplash_medium_small.jpg */; }; - 87B91C421E5C7E5D00A5EC11 /* unsplash_medium_unrotated.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C1F1E5C7E5D00A5EC11 /* unsplash_medium_unrotated.jpg */; }; - 87B91C431E5C7E5D00A5EC11 /* unsplash_original.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C201E5C7E5D00A5EC11 /* unsplash_original.jpg */; }; - 87B91C441E5C7E5D00A5EC11 /* unsplash_original_exif_6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C211E5C7E5D00A5EC11 /* unsplash_original_exif_6.jpg */; }; - 87B91C451E5C7E5D00A5EC11 /* unsplash_original_exif_6_medium.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C221E5C7E5D00A5EC11 /* unsplash_original_exif_6_medium.jpg */; }; - 87B91C461E5C7E5D00A5EC11 /* unsplash_original_medium.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C231E5C7E5D00A5EC11 /* unsplash_original_medium.jpg */; }; - 87B91C471E5C7E5D00A5EC11 /* unsplash_owl_1_MB.png in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C241E5C7E5D00A5EC11 /* unsplash_owl_1_MB.png */; }; - 87B91C481E5C7E5D00A5EC11 /* unsplash_owl_medium.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C251E5C7E5D00A5EC11 /* unsplash_owl_medium.jpg */; }; - 87B91C491E5C7E5D00A5EC11 /* unsplash_owl_small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C261E5C7E5D00A5EC11 /* unsplash_owl_small.jpg */; }; - 87B91C4A1E5C7E5D00A5EC11 /* unsplash_portrait.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C271E5C7E5D00A5EC11 /* unsplash_portrait.jpg */; }; - 87B91C4B1E5C7E5D00A5EC11 /* unsplash_portrait_small_profile.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C281E5C7E5D00A5EC11 /* unsplash_portrait_small_profile.jpg */; }; - 87B91C4C1E5C7E5D00A5EC11 /* unsplash_preview.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C291E5C7E5D00A5EC11 /* unsplash_preview.jpg */; }; - 87B91C4D1E5C7E5D00A5EC11 /* unsplash_preview_small_profile.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C2A1E5C7E5D00A5EC11 /* unsplash_preview_small_profile.jpg */; }; - 87B91C4E1E5C7E5D00A5EC11 /* unsplash_small_profile.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C2B1E5C7E5D00A5EC11 /* unsplash_small_profile.jpg */; }; A9626B4B26932BEA0043CC31 /* ZMImageDownsampleOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9626B4A26932BE90043CC31 /* ZMImageDownsampleOperation.swift */; }; + CBBADE0D2D43C58C0044B7B4 /* ImageProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBADE0C2D43C58C0044B7B4 /* ImageProperties.swift */; }; + CBBAE54A2D43EE960044B7B4 /* ZMImageOwner.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBAE5492D43EE960044B7B4 /* ZMImageOwner.swift */; }; EE98A0B5296EFD3F0055E981 /* WireTesting.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE98A0B4296EFD3F0055E981 /* WireTesting.framework */; }; EE9AEC8A2BD158D600F7853F /* WireImages.docc in Sources */ = {isa = PBXBuildFile; fileRef = EE9AEC892BD158D600F7853F /* WireImages.docc */; }; EEB7138B2B9F37BB00DB27F6 /* ZMImageFormat+StringValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEB7138A2B9F37BB00DB27F6 /* ZMImageFormat+StringValue.swift */; }; - F1E148CF207CE68100F81833 /* ceiling_rotated_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 87B91C0C1E5C7E5D00A5EC11 /* ceiling_rotated_1.jpg */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -107,15 +68,7 @@ 098CB13B1B5FAD5A00712DF9 /* ZMImagePreprocessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZMImagePreprocessor.m; sourceTree = ""; }; 098CB13C1B5FAD5A00712DF9 /* WireImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WireImages.h; sourceTree = ""; }; 098CB1621B5FAD6300712DF9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 098CB1661B5FAD6900712DF9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 09B976C91B6693D700A30B38 /* ZMImagePreprocessorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZMImagePreprocessorTests.m; sourceTree = ""; }; - 09B977361B669B6C00A30B38 /* ZMImageLoadOperationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZMImageLoadOperationTests.m; sourceTree = ""; }; - 09B9773F1B669C8E00A30B38 /* ZMImageDownsampleOperationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZMImageDownsampleOperationTests.m; sourceTree = ""; }; - 09B977421B669CEC00A30B38 /* NSOperationQueue+Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSOperationQueue+Helpers.h"; sourceTree = ""; }; - 09B977431B669CEC00A30B38 /* NSOperationQueue+Helpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSOperationQueue+Helpers.m"; sourceTree = ""; }; 09BCDB581BC664DA0020DCC7 /* ImageOwner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageOwner.swift; sourceTree = ""; }; - 5405B0071BCEBDBF00C0C3BD /* ZMIImageProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZMIImageProperties.h; sourceTree = ""; }; - 5405B0081BCEBDBF00C0C3BD /* ZMIImageProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZMIImageProperties.m; sourceTree = ""; }; 5471F81F1B73E6E000460C35 /* project-common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "project-common.xcconfig"; sourceTree = ""; }; 5471F8201B73E6E000460C35 /* project-debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "project-debug.xcconfig"; sourceTree = ""; }; 5471F8211B73E6E000460C35 /* project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = project.xcconfig; sourceTree = ""; }; @@ -131,42 +84,9 @@ 870253EE1DAB7AA00095D272 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 870253F31DAB7AA00095D272 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 87B91C031E5C586D00A5EC11 /* NSData+MediaMetadata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+MediaMetadata.swift"; sourceTree = ""; }; - 87B91C051E5C5D8600A5EC11 /* NSDataMetadataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDataMetadataTests.swift; sourceTree = ""; }; - 87B91C091E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = ceiling_recompressed_unrotated.jpg; sourceTree = ""; }; - 87B91C0A1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated_preview.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = ceiling_recompressed_unrotated_preview.jpg; sourceTree = ""; }; - 87B91C0C1E5C7E5D00A5EC11 /* ceiling_rotated_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = ceiling_rotated_1.jpg; sourceTree = ""; }; - 87B91C0D1E5C7E5D00A5EC11 /* ceiling_rotated_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ceiling_rotated_2.png; sourceTree = ""; }; - 87B91C0E1E5C7E5D00A5EC11 /* ceiling_rotated_3.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = ceiling_rotated_3.tiff; sourceTree = ""; }; - 87B91C0F1E5C7E5D00A5EC11 /* Lorem Ipsum.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Lorem Ipsum.txt"; sourceTree = ""; }; - 87B91C101E5C7E5D00A5EC11 /* unsplash_720_KB.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_720_KB.jpg; sourceTree = ""; }; - 87B91C111E5C7E5D00A5EC11 /* unsplash_720_KB_preview.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_720_KB_preview.jpg; sourceTree = ""; }; - 87B91C121E5C7E5D00A5EC11 /* unsplash_720_KB_rotated.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_720_KB_rotated.jpg; sourceTree = ""; }; - 87B91C131E5C7E5D00A5EC11 /* unsplash_720_KB_unrotated.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_720_KB_unrotated.jpg; sourceTree = ""; }; - 87B91C141E5C7E5D00A5EC11 /* unsplash_big_gif.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = unsplash_big_gif.gif; sourceTree = ""; }; - 87B91C151E5C7E5D00A5EC11 /* unsplash_medium.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium.jpg; sourceTree = ""; }; - 87B91C161E5C7E5D00A5EC11 /* unsplash_medium_exif_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_2.jpg; sourceTree = ""; }; - 87B91C171E5C7E5D00A5EC11 /* unsplash_medium_exif_3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_3.jpg; sourceTree = ""; }; - 87B91C181E5C7E5D00A5EC11 /* unsplash_medium_exif_4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_4.jpg; sourceTree = ""; }; - 87B91C191E5C7E5D00A5EC11 /* unsplash_medium_exif_5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_5.jpg; sourceTree = ""; }; - 87B91C1A1E5C7E5D00A5EC11 /* unsplash_medium_exif_6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_6.jpg; sourceTree = ""; }; - 87B91C1B1E5C7E5D00A5EC11 /* unsplash_medium_exif_6_small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_6_small.jpg; sourceTree = ""; }; - 87B91C1C1E5C7E5D00A5EC11 /* unsplash_medium_exif_7.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_7.jpg; sourceTree = ""; }; - 87B91C1D1E5C7E5D00A5EC11 /* unsplash_medium_exif_8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_exif_8.jpg; sourceTree = ""; }; - 87B91C1E1E5C7E5D00A5EC11 /* unsplash_medium_small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_small.jpg; sourceTree = ""; }; - 87B91C1F1E5C7E5D00A5EC11 /* unsplash_medium_unrotated.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_medium_unrotated.jpg; sourceTree = ""; }; - 87B91C201E5C7E5D00A5EC11 /* unsplash_original.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_original.jpg; sourceTree = ""; }; - 87B91C211E5C7E5D00A5EC11 /* unsplash_original_exif_6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_original_exif_6.jpg; sourceTree = ""; }; - 87B91C221E5C7E5D00A5EC11 /* unsplash_original_exif_6_medium.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_original_exif_6_medium.jpg; sourceTree = ""; }; - 87B91C231E5C7E5D00A5EC11 /* unsplash_original_medium.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_original_medium.jpg; sourceTree = ""; }; - 87B91C241E5C7E5D00A5EC11 /* unsplash_owl_1_MB.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unsplash_owl_1_MB.png; sourceTree = ""; }; - 87B91C251E5C7E5D00A5EC11 /* unsplash_owl_medium.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_owl_medium.jpg; sourceTree = ""; }; - 87B91C261E5C7E5D00A5EC11 /* unsplash_owl_small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_owl_small.jpg; sourceTree = ""; }; - 87B91C271E5C7E5D00A5EC11 /* unsplash_portrait.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_portrait.jpg; sourceTree = ""; }; - 87B91C281E5C7E5D00A5EC11 /* unsplash_portrait_small_profile.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_portrait_small_profile.jpg; sourceTree = ""; }; - 87B91C291E5C7E5D00A5EC11 /* unsplash_preview.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_preview.jpg; sourceTree = ""; }; - 87B91C2A1E5C7E5D00A5EC11 /* unsplash_preview_small_profile.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_preview_small_profile.jpg; sourceTree = ""; }; - 87B91C2B1E5C7E5D00A5EC11 /* unsplash_small_profile.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = unsplash_small_profile.jpg; sourceTree = ""; }; A9626B4A26932BE90043CC31 /* ZMImageDownsampleOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZMImageDownsampleOperation.swift; sourceTree = ""; }; + CBBADE0C2D43C58C0044B7B4 /* ImageProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageProperties.swift; sourceTree = ""; }; + CBBAE5492D43EE960044B7B4 /* ZMImageOwner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZMImageOwner.swift; sourceTree = ""; }; EE98A0B0296EFD2F0055E981 /* WireUtilities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = WireUtilities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EE98A0B4296EFD3F0055E981 /* WireTesting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = WireTesting.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EE9AEC892BD158D600F7853F /* WireImages.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = WireImages.docc; sourceTree = ""; }; @@ -174,17 +94,25 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 59D264382CF725AF0005317F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + CBBAE5472D43EDF20044B7B4 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( - AllTests.xctestplan, + "OperationQueue+Helpers.swift", + ); + target = 0969600B1B663E7B006DF53B /* WireImages-ios */; + }; + CBBAE5482D43EDF20044B7B4 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + TestPlans/AllTests.xctestplan, ); target = 096960151B663E7C006DF53B /* WireImages-iosTests */; }; /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 59D264372CF725AC0005317F /* TestPlans */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (59D264382CF725AF0005317F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = TestPlans; sourceTree = ""; }; + CBBAE51C2D43EDF10044B7B4 /* Tests */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (CBBAE5472D43EDF20044B7B4 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, CBBAE5482D43EDF20044B7B4 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Tests; sourceTree = ""; }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -259,9 +187,9 @@ EEB7138A2B9F37BB00DB27F6 /* ZMImageFormat+StringValue.swift */, 098CB13A1B5FAD5A00712DF9 /* ZMImagePreprocessor.h */, 098CB13B1B5FAD5A00712DF9 /* ZMImagePreprocessor.m */, - 5405B0071BCEBDBF00C0C3BD /* ZMIImageProperties.h */, - 5405B0081BCEBDBF00C0C3BD /* ZMIImageProperties.m */, 87B91C031E5C586D00A5EC11 /* NSData+MediaMetadata.swift */, + CBBADE0C2D43C58C0044B7B4 /* ImageProperties.swift */, + CBBAE5492D43EE960044B7B4 /* ZMImageOwner.swift */, ); path = "Image Processing"; sourceTree = ""; @@ -275,29 +203,13 @@ path = Resources; sourceTree = ""; }; - 098CB1651B5FAD6900712DF9 /* Tests */ = { - isa = PBXGroup; - children = ( - 59D264372CF725AC0005317F /* TestPlans */, - 098CB1661B5FAD6900712DF9 /* Info.plist */, - 09B976C91B6693D700A30B38 /* ZMImagePreprocessorTests.m */, - 09B977361B669B6C00A30B38 /* ZMImageLoadOperationTests.m */, - 09B9773F1B669C8E00A30B38 /* ZMImageDownsampleOperationTests.m */, - 09B977421B669CEC00A30B38 /* NSOperationQueue+Helpers.h */, - 09B977431B669CEC00A30B38 /* NSOperationQueue+Helpers.m */, - 87B91C051E5C5D8600A5EC11 /* NSDataMetadataTests.swift */, - 87B91C081E5C7E5D00A5EC11 /* Resources */, - ); - path = Tests; - sourceTree = ""; - }; 09DD1EA81B5D41E0005EBCC4 = { isa = PBXGroup; children = ( EE9AEC892BD158D600F7853F /* WireImages.docc */, 098CB1281B5FAD5A00712DF9 /* Sources */, 098CB1611B5FAD6300712DF9 /* Resources */, - 098CB1651B5FAD6900712DF9 /* Tests */, + CBBAE51C2D43EDF10044B7B4 /* Tests */, 870253E11DAB7AA00095D272 /* WireImages-iosTestHost */, 098CB1191B5FA6E100712DF9 /* Frameworks */, 09DD1EB31B5D41E1005EBCC4 /* Products */, @@ -353,47 +265,6 @@ name = "Supporting Files"; sourceTree = ""; }; - 87B91C081E5C7E5D00A5EC11 /* Resources */ = { - isa = PBXGroup; - children = ( - 87B91C091E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated.jpg */, - 87B91C0A1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated_preview.jpg */, - 87B91C0C1E5C7E5D00A5EC11 /* ceiling_rotated_1.jpg */, - 87B91C0D1E5C7E5D00A5EC11 /* ceiling_rotated_2.png */, - 87B91C0E1E5C7E5D00A5EC11 /* ceiling_rotated_3.tiff */, - 87B91C0F1E5C7E5D00A5EC11 /* Lorem Ipsum.txt */, - 87B91C101E5C7E5D00A5EC11 /* unsplash_720_KB.jpg */, - 87B91C111E5C7E5D00A5EC11 /* unsplash_720_KB_preview.jpg */, - 87B91C121E5C7E5D00A5EC11 /* unsplash_720_KB_rotated.jpg */, - 87B91C131E5C7E5D00A5EC11 /* unsplash_720_KB_unrotated.jpg */, - 87B91C141E5C7E5D00A5EC11 /* unsplash_big_gif.gif */, - 87B91C151E5C7E5D00A5EC11 /* unsplash_medium.jpg */, - 87B91C161E5C7E5D00A5EC11 /* unsplash_medium_exif_2.jpg */, - 87B91C171E5C7E5D00A5EC11 /* unsplash_medium_exif_3.jpg */, - 87B91C181E5C7E5D00A5EC11 /* unsplash_medium_exif_4.jpg */, - 87B91C191E5C7E5D00A5EC11 /* unsplash_medium_exif_5.jpg */, - 87B91C1A1E5C7E5D00A5EC11 /* unsplash_medium_exif_6.jpg */, - 87B91C1B1E5C7E5D00A5EC11 /* unsplash_medium_exif_6_small.jpg */, - 87B91C1C1E5C7E5D00A5EC11 /* unsplash_medium_exif_7.jpg */, - 87B91C1D1E5C7E5D00A5EC11 /* unsplash_medium_exif_8.jpg */, - 87B91C1E1E5C7E5D00A5EC11 /* unsplash_medium_small.jpg */, - 87B91C1F1E5C7E5D00A5EC11 /* unsplash_medium_unrotated.jpg */, - 87B91C201E5C7E5D00A5EC11 /* unsplash_original.jpg */, - 87B91C211E5C7E5D00A5EC11 /* unsplash_original_exif_6.jpg */, - 87B91C221E5C7E5D00A5EC11 /* unsplash_original_exif_6_medium.jpg */, - 87B91C231E5C7E5D00A5EC11 /* unsplash_original_medium.jpg */, - 87B91C241E5C7E5D00A5EC11 /* unsplash_owl_1_MB.png */, - 87B91C251E5C7E5D00A5EC11 /* unsplash_owl_medium.jpg */, - 87B91C261E5C7E5D00A5EC11 /* unsplash_owl_small.jpg */, - 87B91C271E5C7E5D00A5EC11 /* unsplash_portrait.jpg */, - 87B91C281E5C7E5D00A5EC11 /* unsplash_portrait_small_profile.jpg */, - 87B91C291E5C7E5D00A5EC11 /* unsplash_preview.jpg */, - 87B91C2A1E5C7E5D00A5EC11 /* unsplash_preview_small_profile.jpg */, - 87B91C2B1E5C7E5D00A5EC11 /* unsplash_small_profile.jpg */, - ); - path = Resources; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -406,7 +277,6 @@ 0969602D1B663EF0006DF53B /* ZMAssetsPreprocessor.h in Headers */, 096960361B663EFC006DF53B /* WireImages.h in Headers */, 096960341B663EF0006DF53B /* ZMImagePreprocessor.h in Headers */, - 5405B0091BCEBDBF00C0C3BD /* ZMIImageProperties.h in Headers */, 096960311B663EF0006DF53B /* ZMImageLoadOperation.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -447,7 +317,7 @@ 096960191B663E7C006DF53B /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( - 59D264372CF725AC0005317F /* TestPlans */, + CBBAE51C2D43EDF10044B7B4 /* Tests */, ); name = "WireImages-iosTests"; productName = "zimages-iosTests"; @@ -530,40 +400,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - F1E148CF207CE68100F81833 /* ceiling_rotated_1.jpg in Resources */, - 87B91C3F1E5C7E5D00A5EC11 /* unsplash_medium_exif_7.jpg in Resources */, - 87B91C2C1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated.jpg in Resources */, - 87B91C451E5C7E5D00A5EC11 /* unsplash_original_exif_6_medium.jpg in Resources */, - 87B91C391E5C7E5D00A5EC11 /* unsplash_medium_exif_2.jpg in Resources */, - 87B91C2D1E5C7E5D00A5EC11 /* ceiling_recompressed_unrotated_preview.jpg in Resources */, - 87B91C311E5C7E5D00A5EC11 /* ceiling_rotated_3.tiff in Resources */, - 87B91C3B1E5C7E5D00A5EC11 /* unsplash_medium_exif_4.jpg in Resources */, - 87B91C3A1E5C7E5D00A5EC11 /* unsplash_medium_exif_3.jpg in Resources */, - 87B91C471E5C7E5D00A5EC11 /* unsplash_owl_1_MB.png in Resources */, - 87B91C351E5C7E5D00A5EC11 /* unsplash_720_KB_rotated.jpg in Resources */, - 87B91C441E5C7E5D00A5EC11 /* unsplash_original_exif_6.jpg in Resources */, - 87B91C341E5C7E5D00A5EC11 /* unsplash_720_KB_preview.jpg in Resources */, - 87B91C331E5C7E5D00A5EC11 /* unsplash_720_KB.jpg in Resources */, - 87B91C381E5C7E5D00A5EC11 /* unsplash_medium.jpg in Resources */, - 87B91C411E5C7E5D00A5EC11 /* unsplash_medium_small.jpg in Resources */, - 87B91C401E5C7E5D00A5EC11 /* unsplash_medium_exif_8.jpg in Resources */, - 87B91C431E5C7E5D00A5EC11 /* unsplash_original.jpg in Resources */, - 87B91C321E5C7E5D00A5EC11 /* Lorem Ipsum.txt in Resources */, - 87B91C371E5C7E5D00A5EC11 /* unsplash_big_gif.gif in Resources */, - 87B91C421E5C7E5D00A5EC11 /* unsplash_medium_unrotated.jpg in Resources */, - 87B91C4A1E5C7E5D00A5EC11 /* unsplash_portrait.jpg in Resources */, - 87B91C301E5C7E5D00A5EC11 /* ceiling_rotated_2.png in Resources */, - 87B91C3C1E5C7E5D00A5EC11 /* unsplash_medium_exif_5.jpg in Resources */, - 87B91C461E5C7E5D00A5EC11 /* unsplash_original_medium.jpg in Resources */, - 87B91C4D1E5C7E5D00A5EC11 /* unsplash_preview_small_profile.jpg in Resources */, - 87B91C3E1E5C7E5D00A5EC11 /* unsplash_medium_exif_6_small.jpg in Resources */, - 87B91C4E1E5C7E5D00A5EC11 /* unsplash_small_profile.jpg in Resources */, - 87B91C481E5C7E5D00A5EC11 /* unsplash_owl_medium.jpg in Resources */, - 87B91C4B1E5C7E5D00A5EC11 /* unsplash_portrait_small_profile.jpg in Resources */, - 87B91C361E5C7E5D00A5EC11 /* unsplash_720_KB_unrotated.jpg in Resources */, - 87B91C491E5C7E5D00A5EC11 /* unsplash_owl_small.jpg in Resources */, - 87B91C4C1E5C7E5D00A5EC11 /* unsplash_preview.jpg in Resources */, - 87B91C3D1E5C7E5D00A5EC11 /* unsplash_medium_exif_6.jpg in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -583,15 +419,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CBBADE0D2D43C58C0044B7B4 /* ImageProperties.swift in Sources */, 096960301B663EF0006DF53B /* ZMImageDownsampleOperation.m in Sources */, 09BCDB591BC664DA0020DCC7 /* ImageOwner.swift in Sources */, 87B91C041E5C586D00A5EC11 /* NSData+MediaMetadata.swift in Sources */, - 5405B00A1BCEBDBF00C0C3BD /* ZMIImageProperties.m in Sources */, EEB7138B2B9F37BB00DB27F6 /* ZMImageFormat+StringValue.swift in Sources */, 096960351B663EF0006DF53B /* ZMImagePreprocessor.m in Sources */, 096960321B663EF0006DF53B /* ZMImageLoadOperation.m in Sources */, EE9AEC8A2BD158D600F7853F /* WireImages.docc in Sources */, 0969602E1B663EF0006DF53B /* ZMAssetsPreprocessor.m in Sources */, + CBBAE54A2D43EE960044B7B4 /* ZMImageOwner.swift in Sources */, A9626B4B26932BEA0043CC31 /* ZMImageDownsampleOperation.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -600,11 +437,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 09B977451B669CEC00A30B38 /* NSOperationQueue+Helpers.m in Sources */, - 87B91C061E5C5D8600A5EC11 /* NSDataMetadataTests.swift in Sources */, - 09B977381B669B6C00A30B38 /* ZMImageLoadOperationTests.m in Sources */, - 09B976CB1B6693D700A30B38 /* ZMImagePreprocessorTests.m in Sources */, - 09B977411B669C8E00A30B38 /* ZMImageDownsampleOperationTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/wire-ios-request-strategy/Sources/Request Strategies/Assets/AssetClientMessageRequestStrategyTests.swift b/wire-ios-request-strategy/Sources/Request Strategies/Assets/AssetClientMessageRequestStrategyTests.swift index 7571545f39d..891c9a1e37f 100644 --- a/wire-ios-request-strategy/Sources/Request Strategies/Assets/AssetClientMessageRequestStrategyTests.swift +++ b/wire-ios-request-strategy/Sources/Request Strategies/Assets/AssetClientMessageRequestStrategyTests.swift @@ -80,7 +80,7 @@ final class AssetClientMessageRequestStrategyTests: MessagingTestBase { if isImage { let size = CGSize(width: 368, height: 520) - let properties = ZMIImageProperties(size: size, length: 1024, mimeType: "image/jpg")! + let properties = ZMIImageProperties(size: size, length: 1024, mimeType: "image/jpg") message.assets.first?.updateWithPreprocessedData(imageData, imageProperties: properties) XCTAssertEqual(message.mimeType, "image/jpg", line: line) XCTAssertEqual(message.size, 1024, line: line)