Latest 1.3.0
Homepage https://github.com/Nixiware/imageresize
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

Version
License
Platform

About

NXImageResize is a category for UIImage that adds the capability to resize by width / height and perform image cropping.
It is especially useful when dealing with images that are downloaded at runtime.

Thread safety

All methods provided by NXImageResize can be called on background threads, however updating the UI (i.e. placing the resulted image inside an UIImageView) still needs to be performed on the main thread.

Methods

All units passed to any of the methods should be in points and not actual pixels. NXImageResize keeps track of the screen pixel density when performing resizing operations.

- (UIImage *)resizeImageToWidth:(CGFloat)width;

Resize an UIImage to a given width.

- (UIImage *)resizeImageToHeight:(CGFloat)height;

Resize an UIImage to a given height.

- (UIImage *)resizeImageToFitWidth:(CGFloat)width andHeight:(CGFloat)height;

Resize an UIImage to fit a given width an height

- (UIImage *)resizeImageToSize:(CGSize)size;

Resize an UIImage to a given CGSize.

- (UIImage *)cropImageInRect:(CGRect)rect;

Crops the contents of an UIImage in a given CGRect.

Usage

1.Add NXImageResize to you project using CocoaPods.

2.Include NXImageResize header file.

#include <NXImageResize/NXImageResize.h>

3.Create an UIImage that you want to resize

UIImage *image = [UIImage imageNamed:@"nameOfTheImage.png"];

4.Perform resize

UIImage *resizedImage = [image resizeImageToWidth:100.0];

More examples can be found in the Example Project.

Requirements

  • ARC
  • iOS >= 7.0

Installation

NXImageResize is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NXImageResize"

License

NXImageResize is available under the MIT license. See the LICENSE file for more info.

Author

Adrian Ilie, Nixiware

@iadi64

Latest podspec

{
    "name": "NXImageResize",
    "version": "1.3.0",
    "summary": "Simple iOS image resize.",
    "description": "NXImageResize is a category for UIImage that adds the capability to resize by width / height and perform image cropping.nIt is especially useful when dealing with images that are downloaded at runtime.",
    "homepage": "https://github.com/Nixiware/imageresize",
    "screenshots": [
        "http://i.imgur.com/s0ifdGz.jpg",
        "http://i.imgur.com/J4BsYF5.jpg"
    ],
    "license": "MIT",
    "authors": {
        "Adrian Ilie, Nixiware": "@iadi64"
    },
    "source": {
        "git": "https://github.com/Nixiware/imageresize.git",
        "tag": "v1.3.0"
    },
    "social_media_url": "https://twitter.com/iadi64",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "NXImageResize": [
            "Pod/Assets/*.png"
        ]
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This