Skip to content

Commit

Permalink
Added podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Schmitt committed Apr 1, 2014
1 parent 6a85baf commit e80b128
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ImagePickerCropDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ImagePickerCropDemo/ImagePickerCropDemo-Prefix.pch";
INFOPLIST_FILE = "ImagePickerCropDemo/ImagePickerCropDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -408,6 +409,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ImagePickerCropDemo/ImagePickerCropDemo-Prefix.pch";
INFOPLIST_FILE = "ImagePickerCropDemo/ImagePickerCropDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down Expand Up @@ -472,6 +474,7 @@
559E887018EB5DB5002E293B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
559E887118EB5DB5002E293B /* Build configuration list for PBXNativeTarget "ImagePickerCropDemoTests" */ = {
isa = XCConfigurationList;
Expand All @@ -480,6 +483,7 @@
559E887318EB5DB5002E293B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
27 changes: 27 additions & 0 deletions UIImage-ImagePickerCrop.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Pod::Spec.new do |s|
s.name = "UIImage-ImagePickerCrop"
s.version = "1.0.1"
s.summary = "Category on UIImage to create full-resolution cropped image from UIImagePickerController info dictionary."

s.description = <<-DESC
The UIImagePickerController class includes a parameter (allowsEditing) that lets the user move and scale the image and crop it to a square shape.
The info dictionary returned as part of the UIImagePickerControllerDelegate protocol includes an "edited" version of the image, but its resolution is limited to a relatively small size.
However, the dictionary also contains a pointer to the full-resolution image along with the the value for the UIImagePickerControllerCropRect key, which is a CGRect corresponding to the area selected by the user.
Unfortunately grabbing a chunk of a UIImage from the device camera is not completely trivial, as the image data is always stored in the device's native orientation with a flag indicating that it should be rotated before being displayed.
So a bit of low-level CoreGraphics-fu is required to rotate and translate the image before selecting the relevant area and drawing it to a CGContext.
This category on UIImage does that in order to create a cropped image at the maximum possible resolution.
DESC

s.homepage = "https://github.com/frankus/UIImage-ImagePickerCrop"
s.license = "MIT"
s.author = { "Frank Schmitt" => "[email protected]" }
s.platform = :ios
s.source = { :git => "https://github.com/frankus/UIImage-ImagePickerCrop.git", :tag => "1.0.1" }
s.source_files = "UIImage+ImagePickerCrop.{h,m}"
s.requires_arc = true
end

0 comments on commit e80b128

Please sign in to comment.