Last active
April 27, 2018 15:40
-
-
Save jedrekk/9d217b4bbf5adab2eab1ff858c4adf2c to your computer and use it in GitHub Desktop.
Get image file resolutions in Mac OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sips -g pixelHeight -g pixelWidth *1x.png | perl -pe's/.*\///;s/\@1x.png\n/,/;s/\s+pixelHeight\:\s([0-9]+)\n/$1,/;s/\s+pixelWidth\:\s//;' | perl -npe 's/(.*),([0-9]+),([0-9]+)/&.$1 div.img { width: $2px; @include pseudo-image($2, $3, \"..\/img\/characters\/$1\@1x.png\", "..\/img\/characters\/$1\@2x.png"); }/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment