Git Product home page Git Product logo

zyimagecompress's Introduction

ZYImageCompress

ZYImageCompress是UIImage的一个扩展,支持图片压缩和缩略图。 图片压缩的算法参考了 Luban鲁班

安装

CocoaPods

pod 'ZYImageCompress'

手动导入

  1. 下载 ZYImageCompress 文件夹所有内容并且拖入你的工程中。
  2. 导入 ZYImageCompress.h`

使用

方法列表

方法 描述
(NSData *)zy_compressForImageBrowser; 图片压缩, 适用于图片浏览器。图片尺寸的算法参考了Luban(鲁班),文件大小的算法有差异
(NSData *)zy_compressForMoments; 图片压缩, 适用于朋友圈。图片尺寸和文件大小的算法都参照Luban(鲁班)
(UIImage *)zy_thumbWithSize:(CGSize)size 生成指定尺寸的缩略图
(NSData *)zy_thumbAndCompressWithSize:(CGSize)size 生成指定尺寸的缩略图,并且压缩图片
(NSData *)zy_thumbAndCompressWithSize:(CGSize)size maxFileSize:(NSInteger)maxFileSize 生成指定尺寸的缩略图,并按照指定文件大小的限值压缩图片
(NSData *)zy_thumbAndCompressWithSize:(CGSize)size maxFileSize:(NSInteger)maxFileSize 生成指定尺寸的缩略图,并按照指定文件大小的限值压缩图片
(NSData *)zy_compressWithMaxFileSize:(NSInteger)maxFileSize initQuality:(double)initQuality 根据指定最大文件大小压缩图片

zyimagecompress's People

Contributors

jerryhu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.