Skip to content

Fix: Use "rwt" file mode for the output image file#926

Merged
lynnik merged 2 commits intoYalantis:develop-non-nativefrom
AdamGrzybkowski:adam/issue_546
Nov 29, 2024
Merged

Fix: Use "rwt" file mode for the output image file#926
lynnik merged 2 commits intoYalantis:develop-non-nativefrom
AdamGrzybkowski:adam/issue_546

Conversation

@AdamGrzybkowski
Copy link
Copy Markdown

@AdamGrzybkowski AdamGrzybkowski commented Aug 27, 2024

Closes #546

This PR fixes an issue with the output file size. No matter how low the compression quality is set the image will remain its original file size after cropping.

The default file mode used when opening the OutputStream for the mImageOutputUri seems to be the culprit. Changing it to wt fixed the issue.

Testing:

Use the sample app and first check the develop-non-native branch.

  1. Use Tmp file destination
  2. Select Resize image to max size - set it to a low value like 500
  3. Set compression quality to 20
  4. Tap pick & crop
  5. Use JPEG
  6. Select an image (big one ideally)
  7. Crop the image
  8. Once finished use the Device Explorer in Android Studio and go to data/data/com.yalantis.ucrop.sample/cache
  9. Check the size of the file SampleCropImage.jpg - compare it with the original

Now check out this branch and repeat the steps above.

@AdamGrzybkowski
Copy link
Copy Markdown
Author

@lynnik It looks like you are one of the maintainers now - can you take a look at this one?

@AdamGrzybkowski AdamGrzybkowski changed the title Use file mode for the output image file Fix: Use "wt" file mode for the output image file Sep 2, 2024
@maxme
Copy link
Copy Markdown

maxme commented Sep 4, 2024

Hey @lynnik, this is kind of blocking for us and we'll probably have to fork and manage our own release of uCrop if we want to continue working with it. Obviously this is not something we would like to do.

Let us know (@AdamGrzybkowski , @hamorillo and @maxme) if you need help with the project and publishing updates, maybe we can help.

@vladlynnik
Copy link
Copy Markdown
Contributor

Hey, @AdamGrzybkowski, thanks for reaching out! We’re currently working on it and will provide an update soon. We'll keep you in the loop.

jens-muenker added a commit to jens-muenker/uCrop-n-Edit that referenced this pull request Sep 15, 2024
@jens-muenker
Copy link
Copy Markdown

I made today a non-native version of my fork and included your bugfix. Maybe that might help you :)

@AdamGrzybkowski AdamGrzybkowski changed the title Fix: Use "wt" file mode for the output image file Fix: Use "rwt" file mode for the output image file Sep 26, 2024
@lynnik lynnik merged commit 369d5d9 into Yalantis:develop-non-native Nov 29, 2024
@prawins
Copy link
Copy Markdown

prawins commented May 5, 2025

android.view.Window.setStatusBarColor
android.view.Window.setNavigationBarColor
android.view.Window.setNavigationBarDividerColor
android.view.Window.getNavigationBarColor
android.view.Window.getStatusBarColor
These start in the following places:

com.yalantis.ucrop.UCropActivity.K
gh.b.i
io.flutter.app.FlutterActivityDelegate.onCreate
io.flutter.embedding.android.FlutterActivity.configureStatusBarForFullscreenFlutterExperience
io.flutter.embedding.android.FlutterFragmentActivity.configureStatusBarForFullscreenFlutterExperience
io.flutter.plugin.platform.PlatformPlugin.setSystemChromeSystemUIOverlayStyle
io.flutter.plugin.platform.b.a
nd.c.onMethodCall
To prepare for the change to Android 15, migrate away from these APIs or parameters.

In playstore this warning is occured , how to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants