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 giving black background for transparent Images #62

Open
rajesh05c4 opened this issue Oct 26, 2018 · 1 comment
Open

Android giving black background for transparent Images #62

rajesh05c4 opened this issue Oct 26, 2018 · 1 comment

Comments

@rajesh05c4
Copy link

rajesh05c4 commented Oct 26, 2018

I am trying to resize an image which has a transparent background. After resizing the image comes with a black background. I did some google around this. I found this solution.

I have used the following code for compressing the images in android. Now it's working fine.
bitmap.setHasAlpha(true); bitmap.compress(Bitmap.CompressFormat.PNG, quality, out);

Please do the above changes in source code.

Thanks in advance.

@iadimitriu
Copy link

I don't think your solution is the best because you change the content format from jpg to png. This plugin returns only 'jpg' files, so, if you change the file format to png you will have to check in your ionic project what platform and output (base64 true or false) is used.

Your link to Stack Overflow has the right answer and here is the implemented solution for the jpg with white background.

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

No branches or pull requests

2 participants