Coder Social home page Coder Social logo

compressor's Introduction

Hi there 👋

I'm an engineer:

  • 🔭 I’m currently working on my Apps:
    • LeafNote: A private Markdown and note App for Android. You can try it on GooglePlay Store or CoolAPK.
    • AnySecret: A password and privacy manager App for iPhone (more platforms will be supported latter). You can try it on Apple Store.
    • One Habit: Habit, Pomodoro and Check-in, An App helps you cultivate a good habit.
    • 英语汪: An app to help Chinese learn english. It could translate words and sentences.
  • 🌱 I’m currently learning iOS development.
  • 📱 My open suorce Apps:
    • MarkNote: An open source markdown note-taking application for Android.
    • OmniList: An open source TODO App for Android.

compressor's People

Contributors

shouheng88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compressor's Issues

部分机型上的旋转问题

有的机型横着拍的,结果裁剪后是竖着显示的。可以读取下相机图片的 ex 信息,对旋转角度做个处理

依赖编译报错

image

没有对Bitmap的直接压缩生成文件的方法吗?就是相机返回的流或者Bitmap直接压缩成文件,要不然还得存成文件再进行压缩增加了步骤,希望可以支持,谢谢!

请问如何控制压缩的图片在50~100k?

博主,首先感谢分享开源你的代码,其中有几个属性很奇怪,我不确定是我用的问题,还是怎么回事,Quality在0-100之间,请问该怎么解读,如题,如果我想控制图片在50~100k之间要怎么处理合适?

Language

Hello, this project is great.
But it will be greater if you translate it to english language so it could go international 😊

Android Q - Uri

Android Q 分区存储对于公共区域的图片只能拿到 Uri,进而拿到 File descriptor,不能获取 File。如果直接读取为 Bitmapbytes[] 则违背了初衷可能导致 OOM。
请求添加对 UriFile descriptorInputStream 的支持。

色彩的存储方法最好也能配置

色彩的存储方法最好也能配置:
public static final Bitmap.Config ALPHA_8
public static final Bitmap.Config ARGB_4444
public static final Bitmap.Config ARGB_8888
public static final Bitmap.Config RGB_565

华为手机上使用问题

在小米手机上使用没有任何问题,可以对图片进行压缩并保存在本地,但是在华为手机上测试时,发现本地没有保存压缩后的图片,测试了两款华为的手机,都是这样的情况,刚开始以为是图片过大的问题,但经过日志记录查看,发现大小没有任何问题,查看记录本地的日志,又发现压缩回调方法里,也没有任何错误信息,还返回成功,大佬,能帮忙解决这个问题吗

需求整理

  1. 直接对原始的图片信息进行压缩(支持多种数据源),Bitmap 或者数组
  2. 获取原始的压缩对象 Bitmap

Java版

后续会提供Java版吗,kotlin代码看着有点吃力。。。谢谢

压缩会经常出现损坏的情况

在pad端出现频率大
MainScope().launch { val resultList = mutableListOf<String>() paths.asFlow() .map { val compress = Compress.with(activity, File(it)) compress.setQuality(60).strategy(Strategies.compressor()).get(Dispatchers.IO).absolutePath }.flowOn(Dispatchers.IO) .catch { onPickListener?.onError() }.onCompletion { if (currentCoroutineContext().isActive) { onPickListener?.onSelected(resultList) } else { onPickListener?.onError() } }.collect { resultList.add(it) } }

请问能指定图片的最大尺寸吗?

比如maxSize=1M,而不是指定maxwidth,maxHeight,一般服务端都跟我说,你图片压缩到不超过1M就行了,他不会跟我说,你压缩到最大分辨率为1080X1920

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.