Skip to content

Instantly share code, notes, and snippets.

@terrywang
Last active March 26, 2017 10:04
Show Gist options
  • Save terrywang/4393851 to your computer and use it in GitHub Desktop.
Save terrywang/4393851 to your computer and use it in GitHub Desktop.
Extract / dump Mac OS X user account picture using dscl (Directory Service command line utility) and convert (hexdump into binary) it to to a JPEG file. NOTE: The resolution can vary depending on the original size of the photo and what version of the operating system you're using when it is saved.
dscl . -read /Users/username JPEGPhoto | tail -1 | xxd -r -p > /path/to/accountImage.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment