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

Option for custom output size/resolution and file path #61

Open
friesenkiwi opened this issue Jul 21, 2017 · 1 comment
Open

Option for custom output size/resolution and file path #61

friesenkiwi opened this issue Jul 21, 2017 · 1 comment

Comments

@friesenkiwi
Copy link

friesenkiwi commented Jul 21, 2017

Hi and thank you for your great plugin!
We recently included it to the https://github.com/AnySoftKeyboard/LanguagePack template to make it easier for contributors to include a custom ic_launcher (the base icon plus a flag for the language) by using the svgmask function.
For release in the Play Store, we need an even bigger (512x512) version than xxxhdpi and also in a different directory.

So it would be great, if one could specify a custom output size, kinda like this:

task svgToDrawablePng(type: SvgDrawableTask) {
    from = files('src/main/svg-png')
    to = file('src/main/play/en-US/listing/icon')
    targetedDensities = ['512x512']
    outputFormat = 'PNG'
    outputType = 'custom'
    svgMaskFiles = files('src/main/svg-png/mask')
    svgMaskResourceFiles = files('src/main/svg-png/mask/svg')
}

What do you think?

Cheers in advance for considering.

@friesenkiwi
Copy link
Author

I was actually able to kind of hack it the way we needed it:
AnySoftKeyboard/LanguagePack@6e877f5

  • cloned the .svgmask file via inkscape but with a document size (and rescaled content) of 512
  • changed outputType to "raw"
  • added a rename operation:
task svgToDrawablePngPlay(type: SvgDrawableTask) {
    from = files('src/main/svg-png/dummy')
    to = file('src/main/play/en-US/listing/icon')
    outputFormat = 'PNG'
    outputType = 'raw'
    svgMaskFiles = files('src/main/svg-png/mask-play')
    svgMaskResourceFiles = files('src/main/svg-png/flag')
    doLast {
        file('src/main/play/en-US/listing/icon/logo_launcher.png').renameTo(file('src/main/play/en-US/listing/icon/ask_logo.png'))
    }

The only "problem" is, that we need two .svgmask files which are essentially the same, apart from the document size and needed upscaling of the content, so the original request is still valid.

Another remark: If one only uses the svgMask feature, then the from = files('') is kind of unnecessary but still needs to be present with an empty dummy directory.

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

1 participant