In SIPS you can get information about an image with getProperty
such as:
sips getProperty all img.jpg
and the above code will render everything associated with that file in the terminal. If you wanted a file to review instead of reading it through the terminal you can try:
sips getProperty all img.jpg >> result.txt
and where ever the image file is placed the above code will create a text file named result.txt with all the information in regards to the image.
Like other scripting languages there is a shorthand approach to calling getProperty
and that is with -g
:
sips -g all img.jpg
I am lazy so I will be demoing the short hand approach in this post and further posts that use SIPS. There are a number of options you can pass to getProperty
when referencing the manual, which can be accessed by man sips
but I prefer to have a reference point on what I can use separate then my terminal so I've included a table:
Special property keys | ||
---|---|---|
Property Name | Type | Read Only |
all | binary data | |
allxml | binary data | |
Image property keys | ||
dpiHeight | float | |
dpiWidth | float | |
pixelHeight | integer | yes |
pixelWidth | integer | yes |
typeIdentifier | string | yes |
format | string | |
formatOptions | string | |
space | string | yes |
samplesPerPixel | integer | yes |
bitsPerSample | integer | yes |
creation | string | yes |
make | string | |
model | string | |
software | string | yes |
description | string | |
copyright | string | |
artist | string | |
profile | binary data | |
hasAlpha | boolean | yes |
Profile property keys | ||
description | utf8 string | |
size | integer | yes |
cmm | string | |
version | string | |
class | string | yes |
space | string | yes |
pcs | string | yes |
creation | string | |
platform | string | |
quality | string | |
deviceManufacturer | string | |
deviceModel | integer | |
deviceAttributes0 | integer | |
deviceAttributes1 | integer | |
renderingIntent | string | |
creator | string | |
copyright | string | |
md5 | string | yes |
While I am still learning how to use SIPS myself do keep in mind it isn't as robust as ImageMagick and though some of the features may be seen in both what I've experienced some could be read only and will require some additional work in either Bash or AppleScript. On the positive note, SIPS is pre-installed on your Mac, for Mavericks+ if I recall, so you do have the opportunity of greater success when deploying scripts to other users.