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

Make thumbnails' scaleType fitCenter #8573

Merged
merged 2 commits into from
Jul 13, 2022
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jul 4, 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

Since the last extractor update (which included TeamNewPipe/NewPipeExtractor#810), YouTube thumbnail urls point to thumbnails with the original aspect ratio preserved (16:9 for normal videos, 9:16 for shorts I think). Before this change, some other "legacy" urls were obtained, which instead pointed to images with pre-added black bars for shorts to make them all 16:9. This change revealed that NewPipe was not treating correctly images with aspect ratios different than 16:9, showing only their center part using the scaleType="centerCrop" property. Instead I used scaleType="fitCenter", see the difference in the screenshots.

SoundCloud and Bandcamp square thumbnails also look better.

I also made it so that playlist thumbnails align left, so that a smaller part of the thumbnail is hidden under the black bar on the right.

Before/After Screenshots/Screen Record

Before After

Fixes the following issue(s)

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

Otherwise e.g. shorts thumbnails would be cropped too much
@AudricV AudricV added feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface multiservice Issues related to multiple services labels Jul 4, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 4, 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

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

Code LGTM.

@Stypox Stypox merged commit d5599eb into TeamNewPipe:dev Jul 13, 2022
@Stypox Stypox deleted the better-thumbnails branch August 4, 2022 09:49
@Stypox Stypox mentioned this pull request Aug 27, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface multiservice Issues related to multiple services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Square thumbnails
3 participants