https://github.com/matkoniecz/rescaling_for_android
Rescale images for Android programs, as Android Studio is incapable of doing this on its own. For now script features hardcoded path, feel free to create an issue if more generic CLI tool would be useful. [keyword for search: resize]
https://github.com/matkoniecz/rescaling_for_android
Last synced: 6 months ago
JSON representation
Rescale images for Android programs, as Android Studio is incapable of doing this on its own. For now script features hardcoded path, feel free to create an issue if more generic CLI tool would be useful. [keyword for search: resize]
- Host: GitHub
- URL: https://github.com/matkoniecz/rescaling_for_android
- Owner: matkoniecz
- Created: 2020-09-06T08:58:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-09T12:16:35.000Z (over 3 years ago)
- Last Synced: 2025-02-14T07:31:57.653Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
> but how on earth do I manage to get the pictures into Android Studio?
Android app expects images to be provided not once, but into multiple sizes.
Manual resizing images and putting them into `app/src/main/res/drawable-mdpi`, `app/src/main/res/drawable-hdpi`, `app/src/main/res/drawable-xhpi`, `app/src/main/res/drawable-xxhdpi` folders is quite obnoxious.
I was unable to automate it using built-in Android Studio feature, or with a working plugin.
I ended creating this Ruby script achieving this.
It can rescale images for Android programs at proper locations.
For now script features hardcoded path, feel free to create an issue if more generic CLI tool would be useful for you.
If you want I may document it better and maybe make it properly configurable. Its dependencies is Ruby (for running script) and imagemagick (for image resizing).
Script is pretty trivial and in the ends it just runs some commands, so porting it to Bash or whatever else should be fairly easy if you want to do this.
## Usage
- Clone this repository.
- Modify hardcoded path (feel free to create an issue if more generic CLI tool would be useful for you)
- Put images into folder with the script
- Run `ruby rescale.rb`