Comments (3)
public static File compressImageFile(Context context, File file, int width, int height, int quality) {
File compressed = new Compressor.Builder(context)
.setMaxWidth(width)
.setMaxHeight(height)
.setQuality(quality)
.setCompressFormat(Bitmap.CompressFormat.JPEG)
.setDestinationDirectoryPath(context.getFilesDir().getAbsolutePath())
.build()
.compressToFile(file);
return compressed;
}
Or save in public directory
.setDestinationDirectoryPath(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getPath())
from compressor.
custom compression files save but the normal comprssion files are not saved it tell me that the file is saved in data/0/id.zelort... cache:compressor/filename.
from compressor.
its saved at apps cached folder, you can't access it directly with file manager. If you need to access it use custom compression with your own destination directory..
from compressor.
Related Issues (20)
- Android compression will lost metadata of image
- PNG size constraint not working HOT 2
- Aren't many satisfy method in Constraint Interface, a CPU Intensive method, why does it run on Dispatchers.IO ?
- Ability to delete cached image. HOT 1
- Delete cache on exception
- Image taken from front camera gets Rotated after compression HOT 2
- Fatal Exception: kotlin.io.NoSuchFileException HOT 1
- Caused by java.io.FileNotFoundException: on Xiaomi Redmi Note 9 HOT 1
- Custom compress not giving the expected image size. HOT 2
- How to add maven dependency of this library
- compressor
- 1
- format(Bitmap.CompressFormat.JPEG)
- Compressed File Size is Constant HOT 1
- File already exist exception when attempting to compress some images (random) HOT 1
- Found a bug
- Found a bug
- Fatal Exception: java.io.IOException close failed: EACCES (Permission denied) HOT 1
- Webp performance is slow and wrong quality issues - Workarounds
- Requested resolution not set for the photo.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compressor.