Comments (4)
I think it is, but if you pass the URI yourself you can manage it yourself. This is also what I'm doing. The current tmp automatic creation is a relict which I haven't cleaned up yet.
from android-image-cropper.
Hello, you should parse your cache directory too. Find any "tmp_image*" or "cropped*" file name and delete it at the end of your flows.
from android-image-cropper.
Thanks, everyone, appreciate the suggestion
Based on @vanniktech suggestion to pass URI, I think I got what I wanted cleaner than deleting the file each time, but I don't know if this will be a problem in the future, I hope you guys can give me your comment
What I changed from your sample is instead of using createTempFile
, I made the file using standard File
outputUri = null
private fun createImageFile(): File {
val fileName = "${Koneksi.FP_FILE_NAME}${Koneksi.FP_FILE_FORMAT}"
val storageDir: File? = myActivity.getExternalFilesDir(Environment.DIRECTORY_PICTURES)
val file = File(storageDir, fileName)
val absolutePath = file.absolutePath
Log.e("HK", "createImageFile path = $absolutePath")
return file
}
And at CropImageContractOptions, I added outputUri on both uri
and customOutputUri
cropImage.launch(
CropImageContractOptions(
uri = outputUri,
cropImageOptions = CropImageOptions(
imageSourceIncludeGallery = false,
imageSourceIncludeCamera = true,
guidelines = CropImageView.Guidelines.ON,
outputCompressFormat = Bitmap.CompressFormat.JPEG,
outputCompressQuality = 85,
fixAspectRatio = true,
aspectRatioX = 1,
aspectRatioY = 1,
customOutputUri = outputUri
)
,
),
)
everything else is still the same as the sample, and using the above code I made the app only make 1 file with the exact name that will be overwritten every time user does the cropping, so no additional code to delete the file needed
from android-image-cropper.
Yep that is also what I do
from android-image-cropper.
Related Issues (20)
- How to Change CropImageActivity's Toolbar? HOT 1
- Android 13 (SDK 33): CropImageView white on some Samsung devices HOT 6
- Getting java.io.IOException on Android 11
- h
- I Dont have any issue i have a question
- Get position Highlight Cropper.
- e HOT 1
- Build failing since version 4.3.3 HOT 1
- Is this repo still being supported or not? HOT 1
- CropImageView fails to respect the match_parent size upon resizing the window HOT 1
- ActivityResultContract for custom activity
- Can I Customize Crip Edit Screen In Android Compose? HOT 1
- URI validation security issue
- Crashing on calling the copping activity...
- Multiple call of cropImage in loop when we can pick more then one image from gallery
- Getting crash while selection of camera cropping only in Android 10
- Question : Is it possible move and scale the picture itself instead of the crop overlay? HOT 3
- v
- Can crop by path or region? HOT 1
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 android-image-cropper.