From b008d2f7c32a5a543d3f6ee234de69659bfa53c3 Mon Sep 17 00:00:00 2001 From: Tomas Sliz Date: Mon, 31 Oct 2016 15:23:52 +0100 Subject: [PATCH 1/4] Add .gitignore file --- .gitignore | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b82cfae --- /dev/null +++ b/.gitignore @@ -0,0 +1,91 @@ +reated by https://www.gitignore.io/api/objective-c,macos + +### Objective-C ### + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xcuserstate + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Objective-C Patch ### +*.xcscmblueprint + + +### macOS ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon +# Thumbnails +._* +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + From 1868b67d245c74131dafff64e132695e6809e4f0 Mon Sep 17 00:00:00 2001 From: Tomas Sliz Date: Mon, 31 Oct 2016 15:24:28 +0100 Subject: [PATCH 2/4] Create Xcode dynamic framework project --- Source/.DS_Store | Bin 6148 -> 0 bytes .../NSTiffSplitter.xcodeproj/project.pbxproj | 300 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + Source/NSTiffSplitter/Info.plist | 24 ++ Source/{ => NSTiffSplitter}/NSTiffSplitter.h | 13 +- Source/{ => NSTiffSplitter}/NSTiffSplitter.m | 2 +- 6 files changed, 342 insertions(+), 4 deletions(-) delete mode 100644 Source/.DS_Store create mode 100644 Source/NSTiffSplitter.xcodeproj/project.pbxproj create mode 100644 Source/NSTiffSplitter.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Source/NSTiffSplitter/Info.plist rename Source/{ => NSTiffSplitter}/NSTiffSplitter.h (64%) rename Source/{ => NSTiffSplitter}/NSTiffSplitter.m (98%) diff --git a/Source/.DS_Store b/Source/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + + + + diff --git a/Source/NSTiffSplitter/Info.plist b/Source/NSTiffSplitter/Info.plist new file mode 100644 index 0000000..452ce9e --- /dev/null +++ b/Source/NSTiffSplitter/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Source/NSTiffSplitter.h b/Source/NSTiffSplitter/NSTiffSplitter.h similarity index 64% rename from Source/NSTiffSplitter.h rename to Source/NSTiffSplitter/NSTiffSplitter.h index 17aa00f..48c5256 100644 --- a/Source/NSTiffSplitter.h +++ b/Source/NSTiffSplitter/NSTiffSplitter.h @@ -1,15 +1,22 @@ // +// NSTiffSplitter.h // NSTiffSplitter // -// Created by Sharrp on 09.05.11. -// Copyright 2011 Anton Furin http://twitter.com/thesharrp All rights reserved. +// Created by Tomas Sliz on 31/10/2016. +// Copyright © 2016 Tomas Sliz. All rights reserved. // #import +//! Project version number for NSTiffSplitter. +FOUNDATION_EXPORT double NSTiffSplitterVersionNumber; + +//! Project version string for NSTiffSplitter. +FOUNDATION_EXPORT const unsigned char NSTiffSplitterVersionString[]; + #define MAX_DEFINED_TYPE 11 // Max allowed to copying field's tag's type. 1-12 tags supported -@interface NSTiffSplitter : NSObject +@interface NSTiffSplitter : NSObject @property (nonatomic) int countOfImages; // count of images in tiff file diff --git a/Source/NSTiffSplitter.m b/Source/NSTiffSplitter/NSTiffSplitter.m similarity index 98% rename from Source/NSTiffSplitter.m rename to Source/NSTiffSplitter/NSTiffSplitter.m index af733be..61d4100 100644 --- a/Source/NSTiffSplitter.m +++ b/Source/NSTiffSplitter/NSTiffSplitter.m @@ -147,7 +147,7 @@ - (id) initWithImageUrl:(NSURL *)imgUrl usingMapping:(BOOL)usingMapping NSError *exception = nil; imgData = [[NSData alloc] initWithContentsOfURL:imgUrl options:NSDataReadingMappedAlways error:&exception]; if (exception != nil) { - NSLog([NSString stringWithFormat:@"%@ exception: description %@, reason %@", NSStringFromSelector(_cmd), exception.localizedDescription, exception.localizedFailureReason]); + NSLog(@"%@ exception: description %@, reason %@", NSStringFromSelector(_cmd), exception.localizedDescription, exception.localizedFailureReason); } } else { imgData = [[NSData alloc] initWithContentsOfURL:imgUrl]; From c5c24b0fb4fe044883072d7d0a3085b9ce2ea125 Mon Sep 17 00:00:00 2001 From: Tomas Sliz Date: Mon, 31 Oct 2016 15:24:47 +0100 Subject: [PATCH 3/4] Add CocoaPods podspec --- NSTiffSplitter.podspec | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 NSTiffSplitter.podspec diff --git a/NSTiffSplitter.podspec b/NSTiffSplitter.podspec new file mode 100644 index 0000000..4f61431 --- /dev/null +++ b/NSTiffSplitter.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |s| + s.name = "NSTiffSplitter" + s.version = "1.0.0" + s.summary = "Objective-C dynamic framework for viewing multipage tiff files on iOS devices." + s.homepage = "https://github.com/Sharrp/NSTiffSplitter" + s.license = "MIT" + + s.authors = { "Anton Sharrp Furin" => "", "Tomas Sliz" => "" } + + s.platform = :ios, "8.0" + + s.source = { :git => "https://github.com/Sharrp/NSTiffSplitter.git", :tag => "#{s.version}" } + + s.source_files = "Source/NSTiffSplitter/*.{h,m}" +end + From 63700ac122e28023d6ddf59e8cfe294188ae19f8 Mon Sep 17 00:00:00 2001 From: Tomas Sliz Date: Wed, 2 Nov 2016 09:59:40 +0100 Subject: [PATCH 4/4] Update README --- README | 26 -------------------------- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 26 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index a3503c4..0000000 --- a/README +++ /dev/null @@ -1,26 +0,0 @@ -NSTiffSplitter -by Anton Sharrp Furin - http://sharrp.blogspot.com - - -How to use it -========================== - -NSTiffSplitter is an Objective-C class which allow you to show multipage TIFF files on iPad / iPhone / iPod Touch. Use it in two steps: - -1) Create NSTiffSplitter instance: - -- (id) initWithData:(NSData *)imgData; -or -- (id) initWithImageUrl:(NSURL *)imgUrl usingMapping:(BOOL)usingMapping; -Second method always use mapping. - -2) Get any page of tiff file with next method: -- (NSData *) dataForImage:(NSUInteger)imageIndex; -It returns monopage tiff file for every page of multipage tiff file. - -You can get count of images in file with countOfImages property. - -- Anton Sharrp Furin - -Web: http://sharrp.blogspot.com -Twitter: http://twitter.com/5hrp diff --git a/README.md b/README.md new file mode 100644 index 0000000..367e20f --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# NSTiffSplitter +by Anton Sharrp Furin - http://sharrp.blogspot.com + + +## How to use it + +NSTiffSplitter is an Objective-C class which allow you to show multipage TIFF files on iPad / iPhone / iPod Touch. Use it in two steps: + +1. Create NSTiffSplitter instance: +```objc +- (id) initWithData:(NSData *)imgData; +``` +or +```objc +- (id) initWithImageUrl:(NSURL *)imgUrl usingMapping:(BOOL)usingMapping; +``` +Second method always use mapping. +2. Get any page of tiff file with next method: +``` +- (NSData *) dataForImage:(NSUInteger)imageIndex; +``` +It returns monopage tiff file for every page of multipage tiff file. + +You can get count of images in file with countOfImages property. + +## Installation + +### CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +To integrate NSTiffSplitter into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '10.0' +use_frameworks! + +target '' do + pod 'NSTiffSplitter', '~> 1.0' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +Anton Sharrp Furin +Web: http://sharrp.blogspot.com +Twitter: http://twitter.com/5hr