Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

A fix for UIImage category #13

Merged
merged 7 commits into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: objective-c
osx_image: xcode7.3
before_script:
script:
- xctool -project bf/bf.xcodeproj -scheme bf -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/croath/UIImageView-BetterFace.svg)](https://travis-ci.org/croath/UIImageView-BetterFace)

UIImageView-BetterFace
======================

Expand All @@ -9,7 +11,7 @@ Looking for an Android version? Check this! [https://github.com/beartung/tclip-a

##Why?

- Have problems showing the resized image previews?
- Have problems showing the resized image previews?
- People in the preview only have chins but not faces?
- A group photo doesn't look well?

Expand All @@ -21,14 +23,14 @@ Like this:

##How?

1. drag `UIImageView+BetterFace.h` and `UIImageView+BetterFace.m` to your project
2. add CoreImage.framework to your project
3. import the .h file
4. add `hack_uiimageview_bf();` to your `main` function
5. add this:`[anImageView setNeedsBetterFace:YES];`
6. done
7. still have problems? clone the project and see the demo.
1. Drag `UIImageView+BetterFace.h` and `UIImageView+BetterFace.m` to your project
2. Add CoreImage.framework to your project
3. Import the .h file
4. Add this:`[anImageView setNeedsBetterFace:YES];`
5. If you want all `setImage:` methods do the magic: Add `hack_uiimageview_bf();` to your `main` function; Otherwise call `setBetterFaceImage:` for every image you want to make the face detection.
6. Done
7. Still have problems? clone the project and see the demo.

##Too slow?

try set the `fast` property to `YES` to get the faster speed(lower accuracy)
Expand All @@ -46,7 +48,7 @@ If you're building your applications using UIImageView-BetterFace, please let me

##Debugging
Add `BF_DEBUG` to your pre compile macros or `#define BF_DEBUG` to your `prefix.pch` file in order to see turn ON debugging logs on the console.

##Other

Any issue and pull request is welcome.
15 changes: 10 additions & 5 deletions bf/bf.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
2783FE381816ADF600F3F6E9 /* up2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 2783FE2D1816ADF600F3F6E9 /* up2.jpg */; };
2783FE391816ADF600F3F6E9 /* up3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 2783FE2E1816ADF600F3F6E9 /* up3.jpg */; };
2783FE3E1816B80000F3F6E9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2783FE3D1816B80000F3F6E9 /* QuartzCore.framework */; };
27A3C2681D5D5DA100EF6666 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27A3C2671D5D5DA100EF6666 /* Launch Screen.storyboard */; };
27C77B4F181707E300F3F073 /* up4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 27C77B4E181707E300F3F073 /* up4.jpg */; };
27C77B51181708BF00F3F073 /* l4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 27C77B50181708BF00F3F073 /* l4.jpg */; };
27C77B53181709F000F3F073 /* m2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 27C77B52181709F000F3F073 /* m2.jpg */; };
Expand Down Expand Up @@ -78,6 +79,7 @@
2783FE2D1816ADF600F3F6E9 /* up2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = up2.jpg; sourceTree = "<group>"; };
2783FE2E1816ADF600F3F6E9 /* up3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = up3.jpg; sourceTree = "<group>"; };
2783FE3D1816B80000F3F6E9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
27A3C2671D5D5DA100EF6666 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
27C77B4E181707E300F3F073 /* up4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = up4.jpg; sourceTree = "<group>"; };
27C77B50181708BF00F3F073 /* l4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = l4.jpg; sourceTree = "<group>"; };
27C77B52181709F000F3F073 /* m2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = m2.jpg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,6 +153,7 @@
2783FDF8181697D200F3F6E9 /* AppDelegate.h */,
2783FDF9181697D200F3F6E9 /* AppDelegate.m */,
2783FDFB181697D200F3F6E9 /* Main.storyboard */,
27A3C2671D5D5DA100EF6666 /* Launch Screen.storyboard */,
2783FDFE181697D200F3F6E9 /* ViewController.h */,
2783FDFF181697D200F3F6E9 /* ViewController.m */,
2783FE01181697D200F3F6E9 /* Images.xcassets */,
Expand Down Expand Up @@ -284,7 +287,7 @@
2783FDDE181697D200F3F6E9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Croath;
TargetAttributes = {
2783FE06181697D200F3F6E9 = {
Expand Down Expand Up @@ -322,6 +325,7 @@
2783FE341816ADF600F3F6E9 /* l2.jpg in Resources */,
2783FE381816ADF600F3F6E9 /* up2.jpg in Resources */,
2783FE02181697D200F3F6E9 /* Images.xcassets in Resources */,
27A3C2681D5D5DA100EF6666 /* Launch Screen.storyboard in Resources */,
27C77B51181708BF00F3F073 /* l4.jpg in Resources */,
2783FE371816ADF600F3F6E9 /* up1.jpg in Resources */,
2783FDF4181697D200F3F6E9 /* InfoPlist.strings in Resources */,
Expand Down Expand Up @@ -405,7 +409,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -420,6 +423,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -444,7 +448,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -481,6 +484,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "bf/bf-Prefix.pch";
INFOPLIST_FILE = "bf/bf-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.croath.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -494,6 +498,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "bf/bf-Prefix.pch";
INFOPLIST_FILE = "bf/bf-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.croath.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -502,7 +507,6 @@
2783FE1C181697D300F3F6E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/bf.app/bf";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
Expand All @@ -516,6 +520,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "bfTests/bfTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.croath.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand All @@ -525,7 +530,6 @@
2783FE1D181697D300F3F6E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/bf.app/bf";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
Expand All @@ -535,6 +539,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "bf/bf-Prefix.pch";
INFOPLIST_FILE = "bfTests/bfTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.croath.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand Down
101 changes: 101 additions & 0 deletions bf/bf.xcodeproj/xcshareddata/xcschemes/bf.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2783FDE5181697D200F3F6E9"
BuildableName = "bf.app"
BlueprintName = "bf"
ReferencedContainer = "container:bf.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2783FE06181697D200F3F6E9"
BuildableName = "bfTests.xctest"
BlueprintName = "bfTests"
ReferencedContainer = "container:bf.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2783FDE5181697D200F3F6E9"
BuildableName = "bf.app"
BlueprintName = "bf"
ReferencedContainer = "container:bf.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2783FDE5181697D200F3F6E9"
BuildableName = "bf.app"
BlueprintName = "bf"
ReferencedContainer = "container:bf.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2783FDE5181697D200F3F6E9"
BuildableName = "bf.app"
BlueprintName = "bf"
ReferencedContainer = "container:bf.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading