Last active
May 2, 2018 19:48
-
-
Save yig/9055ca0f34949532a4183dd284614e03 to your computer and use it in GitHub Desktop.
Create PNG thumbnails for OBJ files on OS X using built-in QuickLook (and ImageMagick `mogrify` to trim them afterwards)
This file contains hidden or 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
| #!/bin/bash | |
| ''' | |
| Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
| License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
| Description: Create PNG thumbnails for OBJ files on OS X using built-in QuickLook (and ImageMagick `mogrify` to trim them afterwards). | |
| ''' | |
| for obj_file in "$@"; do | |
| ## qlmanage comes with OS X | |
| qlmanage -o "$(dirname "${obj_file}")" -t -s 1024 "${obj_file}" | |
| ## mogrify is part of ImageMagick: brew install imagemagick | |
| mogrify -trim "${obj_file}".png | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment