ios-photo-manipulator

所属分类:内容生成
开发工具:Swift
文件大小:118KB
下载次数:0
上传日期:2021-05-30 07:27:14
上 传 者sh-1993
说明:  用于在iOS中以编程方式编辑照片的图像处理库。它可以打印文本,覆盖其他图像(添加水印...
(Image processing library to edit photo programmatically in iOS. It can print text, overlay other image (add watermark), resize, crop and optimize image size, convert format to jpeg or png)

文件列表:
.travis.yml (1157, 2021-05-30)
LICENSE (1082, 2021-05-30)
WCPhotoManipulator.podspec (893, 2021-05-30)
WCPhotoManipulator.xcodeproj (0, 2021-05-30)
WCPhotoManipulator.xcodeproj\project.pbxproj (24861, 2021-05-30)
WCPhotoManipulator.xcodeproj\project.xcworkspace (0, 2021-05-30)
WCPhotoManipulator.xcodeproj\project.xcworkspace\contents.xcworkspacedata (163, 2021-05-30)
WCPhotoManipulator.xcodeproj\project.xcworkspace\xcshareddata (0, 2021-05-30)
WCPhotoManipulator.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (238, 2021-05-30)
WCPhotoManipulator.xcodeproj\xcshareddata (0, 2021-05-30)
WCPhotoManipulator.xcodeproj\xcshareddata\xcschemes (0, 2021-05-30)
WCPhotoManipulator.xcodeproj\xcshareddata\xcschemes\WCPhotoManipulator.xcscheme (3941, 2021-05-30)
WCPhotoManipulator (0, 2021-05-30)
WCPhotoManipulator\BitmapUtils.swift (5387, 2021-05-30)
WCPhotoManipulator\FileUtils.swift (2132, 2021-05-30)
WCPhotoManipulator\FoolSonarcloud.h (303, 2021-05-30)
WCPhotoManipulator\FoolSonarcloud.m (242, 2021-05-30)
WCPhotoManipulator\MimeUtils.swift (489, 2021-05-30)
WCPhotoManipulator\ResizeMode.swift (267, 2021-05-30)
WCPhotoManipulator\UIImage+PhotoManipulator.swift (3827, 2021-05-30)
WCPhotoManipulator\WCPhotoManipulator-Bridging-Header.h (104, 2021-05-30)
WCPhotoManipulatorTests (0, 2021-05-30)
WCPhotoManipulatorTests\BitmapUtilsObjCTests.m (13334, 2021-05-30)
WCPhotoManipulatorTests\BitmapUtilsSwiftTests.swift (11917, 2021-05-30)
WCPhotoManipulatorTests\FileUtilsObjCTests.m (5626, 2021-05-30)
WCPhotoManipulatorTests\FileUtilsSwiftTests.swift (5712, 2021-05-30)
WCPhotoManipulatorTests\Helpers (0, 2021-05-30)
WCPhotoManipulatorTests\Helpers\NSData+Testing.h (321, 2021-05-30)
WCPhotoManipulatorTests\Helpers\NSData+Testing.m (597, 2021-05-30)
WCPhotoManipulatorTests\Helpers\UIImage+Testing.h (416, 2021-05-30)
WCPhotoManipulatorTests\Helpers\UIImage+Testing.m (3350, 2021-05-30)
WCPhotoManipulatorTests\Images (0, 2021-05-30)
WCPhotoManipulatorTests\Images\background.jpg (80180, 2021-05-30)
... ...

# iOS Photo Manipulator [![Build and Test](https://github.com/guhungry/ios-photo-manipulator/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/guhungry/ios-photo-manipulator/actions/workflows/build-and-test.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=guhungry_ios-photo-manipulator&metric=alert_status)](https://sonarcloud.io/dashboard?id=guhungry_ios-photo-manipulator) [![cocoapods](https://cocoapod-badges.herokuapp.com/v/WCPhotoManipulator/badge.png)](https://cocoapods.org/pods/WCPhotoManipulator) Image processing library to edit image programmatically for iOS. This library is used by [react-native-photo-manipulator](https://github.com/guhungry/react-native-photo-manipulator/). ## Installation Add dependency `Podfile` ```rb # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'Demo' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Add WCPhotoManipulator pod 'WCPhotoManipulator', :git => 'https://github.com/guhungry/ios-photo-manipulator.git', :tag => 'v1.0.0' end ``` ## Usage Import using ```objc @import WCPhotoManipulator; ``` ## Usage UIImage+PhotoManipulator ### [image crop] Crop image from specified `cropRegion` | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-----------------------------------------------------------| | cropRegion | CGRect | Yes | Region to be crop in CGRect(`x`, `y`, `size`, `width`) | | scale | CGFloat | No | Scale of result image. Default = image.scale | ### [image resize] Resize image from specified into `targetSize` using resize mode `cover` | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-----------------------------------------------------------| | targetSize | CGSize | Yes | Size of result image | | scale | CGFloat | No | Scale of result image. Default = image.scale | ### [image drawText] Print text into image | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|------------------------------------------------------------------------| | text | NSString | Yes | Text to print in image | | position | CGPoint | Yes | Position to in in `x`, `y` | | color | UIColor* | Yes | Text color | | font | UIFont | Yes | Font to use | | thickness | Float | No | Outline of text. Default = 0 | | scale | CGFloat | No | Scale of result image. Default = image.scale | ### [image overlayImage] Overlay image on top of background image | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|------------------------------------------------------------------------| | overlay | UIImage* | Yes | Overlay image | | position | CGPoint | Yes | Position of overlay image in background image | ## Usage FileUtils ### [FileUtils createTempFile] Create temp file into cache directory with prefix | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-------------------------------------------------| | prefix | NSString | Yes | Temp file name prefix | | mimeType | NSString | Yes | Mime type of image. Default = image/jpeg | ### [FileUtils cachePath] Get cache path of app ### [FileUtils cleanDirectory] Delete all files in directory with prefix | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-------------------------------------------------| | directory | NSString | Yes | Path to clean | | prefix | NSString | Yes | File name prefix to match | ### [FileUtils saveImageFile] Save image to target path | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-----------------------------------------------------------| | image | UII mage | Yes | Source image | | mimeType | NSString | Yes | Mime type of target file | | quality | CGFloat | Yes | Quality of image between 0 - 1(For jpg only) | | file | NSString | Yes | Target file path | ### [FileUtils imageFromUrl] Open file from uri as input stream | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-----------------------------------------------------------| | uri | String | Yes | Uri of image can be remote (https?://) or local (file://) | ## Usage MimeUtils ### [MimeUtils toExtension] Get image file extension from mimeType (Support .jpg, .png and .webp) | NAME | TYPE | REQUIRED | DESCRIPTION | |------------|-----------------------|----------|-------------------------------------------------| | mimeType | String | Yes | Image mime type |

近期下载者

相关文件


收藏者