• Stars
    star
    600
  • Rank 74,128 (Top 2 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An easy to use image compress library for Android.

An advanced image compress library for Android

License Version Code Grade Build Min Sdk Version Author QQ Group

中文版

An advanced image compress library for Android. Allow you to custom

  • Image source types (Uri/File/bitmap/Byte array/Custom...)
  • Result image types (Bitmap/File)
  • Compress task execution mode (Blocking/RxJava/Kotlin coroutines/AsyncTask)
  • Image compress algorithms

To use the library, to add maven central at first,

repositories { mavenCentral() }

then, add our library in your dependency:

implementation 'com.github.Shouheng88:compressor:latest-version'

Sample: to compress an Uri image, try to get result as File and launch in kotlin coroutines. The code will be,

GlobalScope.launch {
    val result = Compress.with(context, file.uri(context))
        .setQuality(80)
        .concrete {
            withMaxWidth(100f)
            withMaxHeight(100f)
            withScaleMode(ScaleMode.SCALE_HEIGHT)
            withIgnoreIfSmaller(true)
        }
        .get(Dispatchers.IO)
    withContext(Dispatchers.Main) {
        Glide.with(context).load(result).into(binding.iv6)
    }
}

The library allows you to cusotm a lot. So,

License

Copyright (c) 2019-2021 Shouheng Wang.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

MarkNote

An open sourced markdown note-taking application for Android.
Java
890
star
2

iCamera

Yet another camera library for Android.
Kotlin
462
star
3

AwesomeSwift

❤️ SwiftUI All In One Example.
Swift
238
star
4

arch-android

Type based Jetpack MVVM library.
Kotlin
220
star
5

Android-references

[DEPRECATE] 请访问新项目 https://github.com/Shouheng88/Android-VMLib 👏 Android 示例程序:MVP, MVVM, 组件化, AndroidX, ARouter, RxJava, EventBus, ButterKnife, 视频播放, 视频直播, 网络访问, 布局和控件整理等
Java
214
star
6

Android-notes

[DEPRECATED] Articles, notes, interview questions and resources management for Android.
156
star
7

OmniList

开源的时间管理App,基于Material Design设计
Java
93
star
8

AndroidStartup

An Android startup jobs sceduler.
Kotlin
51
star
9

EasyMark

The markdown parser, editor and viewer for Android which is rather easy to integrate.
Java
47
star
10

autopackage

An Android auto package script.
Python
38
star
11

AndroidTools

🔧 Many useful tools for Android development, adb wrapper, smali, languages etc.
Python
38
star
12

xDialog

An beautiful and easy to use dialog library for Android.
Kotlin
24
star
13

LeafNote-Community

A platform to share information and materials about Leaf Note.
18
star
14

xAdapter

A convenient way to use Adapter in RecyclerView based on Kotlin DSL and BRVAH.
Kotlin
17
star
15

Seed

Booster is a SpringBoot generator used to genrate everything for your Springboot App to accelate your server development.
Java
13
star
16

products-spider

JD & TB products spider.
Python
11
star
17

jarjar

一个 Jar 瘦身工具,用来从 jar 文件中移除你调用不到的类文件。可以用来做 Android 包体积优化优化。
Python
10
star
18

the-chinese-city-rank

中国城市排行,选择更适合你定居的城市
Python
3
star
19

Shouheng88

3
star
20

Springcloud-references

the basic show cases of spring cloud development
Java
2
star