paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

Support custom thumbnail scale

Open IlyaGulya opened this issue 2 years ago • 1 comments

Currently Paparazzi limits thumbnail size (I suppose for saving space). But there's some tasks where it is not a good approach:

  1. Paparazzi can be used for screenshot generation (that's my case)
  2. I suppose current behavior will drastically affect long screenshots image quality

This PR adds new API. You can prodvide instance of ThumbnailScale into Paparazzi constructor.

ThumbnailScale can be:

  • NoScale - image would not be scaled at all
  • ScaleMaxSideTo - current behavior. Image will be scaled for max side to be no longer than ScaleMaxSideTo.size.

IlyaGulya avatar Sep 06 '22 09:09 IlyaGulya

I think accomplishes the same as my PR https://github.com/cashapp/paparazzi/pull/543

sdoward avatar Sep 26 '22 21:09 sdoward

In case someone wants to use this PR before it is merged, I've published release 1.3.1 with this PR applied. Add this repo to your settings.gradle.kts like this:

dependencyResolutionManagement {
    repositories {
        /// ...
        maven("https://maven.pkg.github.com/IlyaGulya/paparazzi") {
            name = "github"
            credentials(PasswordCredentials::class.java)
        }
    }
}

pluginManagement {
    repositories {
        /// ...
        maven("https://maven.pkg.github.com/IlyaGulya/paparazzi") {
            name = "github"
            credentials(PasswordCredentials::class.java)
        }
    }
}

And add your username and fine-grained personal access token to your gradle.properties:

githubUsername=YOUR_USERNAME
githubPassword=YOUR_PERSONAL_ACCESS_TOKEN

After that you can use 1.3.1-thumbnail-scale-5 as paparazzi plugin version:

plugins {
    id("app.cash.paparazzi") version "1.3.1-thumbnail-scale-5"
}

IlyaGulya avatar Aug 09 '23 10:08 IlyaGulya