A simple Ruby script to organize a folder of images into their respective drawable_<dpi> folders for use on Android.
Just symlink the droidsorter script into your usr/local/bin folder. The usage is pretty straightforward.
- Position yourself into the folder with an export of the images you want to organize. The images should be suffixed with their respective size.
- e.g.
image@3xwill get moved into thedrawable_xxhdpiandimage@1,5xwill get moved into thedrawable_hdpifolder.
- e.g.
- Once you're positioned in the folder, just run
droidsorterand that's it.- Note #1: The images will lose their suffix once they are positioned in the folder.
- Note #2: Android requires you to name your files using underscores. If your filename contains dashes, Droidsorter will replace them with underscores (e.g.
toolbar-filter-icon.pngwill turn intotoolbar_filter_icon.png).