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

Use smoother bitmap downscaling for thumbnails. #8686

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Jul 24, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Before/After Screenshots/Screen Record

Screenshot_20220804-193704.jpg

Fixes the following issue(s)

  • Fixes #

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@Isira-Seneviratne Isira-Seneviratne marked this pull request as ready for review July 24, 2022 05:21
@Isira-Seneviratne
Copy link
Member Author

When checking the change in PicassoHelper on my Galaxy Tab A6 (Android 8.1), I found that the result bitmap was mutable while the source was immutable, so I removed the bug fix for the issue mentioned. I'll restore it if needed.

@triallax triallax added the codequality Improvements to the codebase to improve the code quality label Jul 24, 2022
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_BitmapCompat_createScaledBitmap branch from ae9ed80 to 867d641 Compare August 1, 2022 02:56
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Could you provide screenshots for comparison? Does the benefits exceed the cost of possibly having bugs or crashes?

@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Aug 4, 2022

Could you provide screenshots for comparison? Does the benefits exceed the cost of possibly having bugs or crashes?

Screenshot_20220804-193704.jpg

The documentation mentions that a mutable bitmap is returned if the original was immutable.

Edit: If the source bitmap was not returned, and the source is returned if the new dimensions were the same as the original.

@Stypox
Copy link
Member

Stypox commented Aug 4, 2022

@gulachev @arielshulman could you test if this PR still works fine, or if it reintroduces #4638? Assuming you still have the same phone.

@Isira-Seneviratne Isira-Seneviratne changed the title Use BitmapCompat.createScaledBitmap(). Use BitmapCompat.createScaledBitmap() for thumbnails. Aug 4, 2022
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_BitmapCompat_createScaledBitmap branch from 39a39c0 to a2c4b05 Compare August 5, 2022 00:01
@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Aug 5, 2022

@Stypox I added a mutable copy operation if the resulting bitmap was immutable (this only happens if the source bitmap was returned and it was immutable).

@mhmdanas Can you update the labels?

@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_BitmapCompat_createScaledBitmap branch from a2c4b05 to 34e1e94 Compare August 6, 2022 14:45
@arielshulman
Copy link
Contributor

@gulachev @arielshulman could you test if this PR still works fine, or if it reintroduces #4638? Assuming you still have the same phone.

Hey, brought that phone to my boy...
I've tested the apk from CI and it worked great with those specific bitmaps which crashed the phone when it displayed on notification bar.

@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_BitmapCompat_createScaledBitmap branch 3 times, most recently from 0069883 to a387191 Compare August 13, 2022 00:32
@Isira-Seneviratne Isira-Seneviratne changed the title Use BitmapCompat.createScaledBitmap() for thumbnails. Use smoother bitmap downscaling for thumbnails. Aug 13, 2022
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_BitmapCompat_createScaledBitmap branch from a387191 to 6cea7d6 Compare August 15, 2022 01:59
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

lgtm

@TobiGr TobiGr requested a review from Stypox October 9, 2022 21:18
@Stypox Stypox closed this Nov 29, 2022
@Stypox Stypox force-pushed the Use_BitmapCompat_createScaledBitmap branch from 75312c3 to 4b7de86 Compare November 29, 2022 14:54
@sonarcloud
Copy link

sonarcloud bot commented Nov 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Stypox
Copy link
Member

Stypox commented Nov 29, 2022

Something strange happened. Anyway, this is approved and merged in #9479, thanks @Isira-Seneviratne :-)

@Isira-Seneviratne Isira-Seneviratne deleted the Use_BitmapCompat_createScaledBitmap branch December 6, 2022 14:24
@Stypox Stypox mentioned this pull request Jan 22, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants