Skip to content

Instantly share code, notes, and snippets.

@MarioRicalde
Last active August 29, 2015 13:56
Show Gist options
  • Save MarioRicalde/9267893 to your computer and use it in GitHub Desktop.
Save MarioRicalde/9267893 to your computer and use it in GitHub Desktop.
Copy the image dimensions as CSS via Terminal.
function imgdim() {
echo "Image Dimensions copied to the Clipboard."
sips -g pixelHeight -g pixelWidth $1 | sed '1 d' | sed 's/ pixelHeight: \(.*\)/height: \1px;/' | sed 's/ pixelWidth: \(.*\)/width: \1px;/' | pbcopy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment