Resizer

A library for resizing images, etc

License

License

GroupId

GroupId

cn.loveswift
ArtifactId

ArtifactId

resizer
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Resizer
A library for resizing images, etc

Download resizer

Dependencies

compile (1)

Group / Artifact Type Version
net.coobird : thumbnailator jar 0.4.12

Project Modules

There are no modules declared in this project.

Resizer

Installing

  • maven
<!-- https://mvnrepository.com/artifact/cn.loveswift/resizer -->
<dependency>
    <groupId>cn.loveswift</groupId>
    <artifactId>resizer</artifactId>
    <version>0.2.0</version>
</dependency>
  • gradle
// https://mvnrepository.com/artifact/cn.loveswift/resizer
compile group: 'cn.loveswift', name: 'resizer', version: '0.2.0'

Getting started

Import Package

import cn.loveswift.resizer.Image;

Usage

  • From byte[]
byte[] inImageByteArray = ...;
byte[] outImageByteArray = Image.scaleRange(inImageByteArray, 100 * 1024, 200 * 1024); // Adjust the image size to 100kb ~ 200KB
  • From pathname
String inImagePathname = "/path/to/image";
byte[] outImageByteArray = Image.scaleRange(inImagePathname, 100 * 1024, 200 * 1024); // Adjust the image size to 100kb ~ 200KB

Versions

Version
0.2.0