Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android less than 11 compression bitmap #17

Merged
merged 2 commits into from
May 10, 2024
Merged

Conversation

dinitri
Copy link
Member

@dinitri dinitri commented May 9, 2024

No description provided.

@@ -80,6 +80,12 @@ private void transcodeImage(String path, int size, CallbackContext callbackConte
callbackContext.error("Failed to compress image");
return;
}
} else {
Log.d("Warning","Cannot compress image on Android version < 11");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Log.d("Warning","Cannot compress image on Android version < 11");
Log.d("Warning","Cannot compress image on Android version < 11");

can we use callbackContext.error here

@@ -80,6 +80,12 @@ private void transcodeImage(String path, int size, CallbackContext callbackConte
callbackContext.error("Failed to compress image");
return;
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be outside the try block?

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
    // error handling or logging
    // return or equivalent
try (...)
    // compress

@@ -80,6 +80,12 @@ private void transcodeImage(String path, int size, CallbackContext callbackConte
callbackContext.error("Failed to compress image");
return;
}
} else {
Log.d("Warning","Cannot compress image on Android version < 11");
Copy link
Member

@HashirRajah HashirRajah May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put < Build.VERSION_CODES.R instead of < 11 directly?

@dinitri dinitri merged commit 9abd8e6 into master May 10, 2024
1 check passed
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.

4 participants