[sips]カラー判定
サンプルコード
行番号 | ソース |
---|---|
001 | |
002 | set strFilePath to ("/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/curtainlock.tif") as text |
003 | |
004 | |
005 | set strCommandText to ("/usr/bin/sips -g bitsPerSample -g space \"" & strFilePath & "\" | awk '{print $2}'") as text |
006 | log strCommandText |
007 | try |
008 | set strResponse to (do shell script strCommandText) as text |
009 | on error |
010 | return "エラーしました" |
011 | end try |
012 | |
013 | |
014 | set AppleScript's text item delimiters to "\r" |
015 | set listResponst to every text item of strResponse |
016 | set AppleScript's text item delimiters to "" |
017 | |
018 | |
019 | repeat with itemRespons in listResponst |
020 | |
021 | if itemRespons contains "1" then |
022 | set strBPS to ("1BIT白黒です") as text |
023 | else if itemRespons contains "8" then |
024 | set strBPS to ("256階調") as text |
025 | else if itemRespons contains "16" then |
026 | set strBPS to ("65536階調") as text |
027 | else if itemRespons contains "32" then |
028 | set strBPS to ("HDR") as text |
029 | else if itemRespons contains "RGB" then |
030 | set strColor to ("RGB") as text |
031 | else if itemRespons contains "CMYK" then |
032 | set strColor to ("CMYK") as text |
033 | else if itemRespons contains "Gray" then |
034 | set strColor to ("Gray") as text |
035 | end if |
036 | |
037 | end repeat |
038 | log strColor |
039 | log strBPS |
AppleScriptで生成しました |
SIPSキー一覧
Image property keys:
dpiHeight float
dpiWidth float
pixelHeight integer (read-only)
pixelWidth integer (read-only)
typeIdentifier string (read-only)
format string jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga
formatOptions string default | [low|normal|high|best|
space string (read-only)
samplesPerPixel integer (read-only)
bitsPerSample integer (read-only)
creation string (read-only)
make string
model string
software string (read-only)
description string
copyright string
artist string
profilebinary data
hasAlpha boolean (read-only)
Profile property keys:
description utf8 string
size integer (read-only)
cmm string
version string
classstring (read-only)
spacestring (read-only)
pcs string (read-only)
creation string
platform string
quality string normal | draft | best
deviceManufacturer string
deviceModel integer
deviceAttributes0 integer
deviceAttributes1 integer
renderingIntentstring perceptual | relative | saturation | absolute
creator string
copyright string
md5 string (read-only)
| 固定リンク