作りたいアプリがあるのでExifの情報を整理する。
こんな感じのコードを書いて取得した
なまえ | 意味 |
---|---|
Exif | 画像の持つ位置情報やなんやかんや |
ApertureValue |
func loadAlbums() {
self.assetLibrary = ALAssetsLibrary()
var assetsArray : [ALAsset] = []
var imageArray : [CGImage] = []
var count = 0
var countOne = 0
let assetsType : ALAssetsGroupType = Int(ALAssetsGroupAll)
var groupBlock : ALAssetsLibraryGroupsEnumerationResultsBlock = {
(group: ALAssetsGroup!, stop: UnsafeMutablePointer<ObjCBool>) in
if group != nil
{
if ((group.valueForProperty(ALAssetsGroupPropertyName) as NSString) == "sc")
{
var assetBlock : ALAssetsGroupEnumerationResultsBlock = {
(result: ALAsset!, index: Int, stop: UnsafeMutablePointer<ObjCBool>) in
if result != nil
{
println(index)
var meta = result.defaultRepresentation().metadata()
println(meta)
}
}
group.enumerateAssetsUsingBlock(assetBlock)
}
}
}
var groupFailureBlock : ALAssetsLibraryAccessFailureBlock = {
(NSError) in
println("errorrrrrrrr")
}
assetLibrary.enumerateGroupsWithTypes(assetsType, usingBlock: groupBlock, failureBlock: groupFailureBlock)
}
1枚目 iPhoneで撮影した写真
[{Exif}: {
ApertureValue = "2.275007124536905";
BrightnessValue = "1.784757118927973";
ColorSpace = 1;
ComponentsConfiguration = (
1,
2,
3,
0
);
DateTimeDigitized = "2014:12:21 10:34:52";
DateTimeOriginal = "2014:12:21 10:34:52";
ExifVersion = (
2,
2,
1
);
ExposureBiasValue = 0;
ExposureMode = 0;
ExposureProgram = 2;
ExposureTime = "0.0303030303030303";
FNumber = "2.2";
Flash = 16;
FlashPixVersion = (
1,
0
);
FocalLenIn35mmFilm = 29;
FocalLength = "4.15";
ISOSpeedRatings = (
250
);
LensMake = Apple;
LensModel = "iPhone 5s back camera 4.15mm f/2.2";
LensSpecification = (
"4.15",
"4.15",
"2.2",
"2.2"
);
MeteringMode = 3;
PixelXDimension = 3264;
PixelYDimension = 2448;
SceneCaptureType = 0;
SceneType = 1;
SensingMethod = 2;
ShutterSpeedValue = "5.059471365638767";
SubjectArea = (
2224,
1003,
610,
612
);
SubsecTimeDigitized = 310;
SubsecTimeOriginal = 310;
WhiteBalance = 0;
}, {TIFF}: {
DateTime = "2014:12:21 10:34:52";
Make = Apple;
Model = "iPhone 5s";
Orientation = 6;
ResolutionUnit = 2;
Software = "8.1.1";
XResolution = 72;
YResolution = 72;
}, DPIWidth: 72, PixelWidth: 3264, PixelHeight: 2448, ColorModel: RGB, {MakerApple}: {
1 = 2;
14 = 1;
2 = <a3006600 18002200 30008800 c000ee00 e001f601 04021702 4a01f400 a500c401 c7006a00 13001300 1e006900 a800e400 15020002 f5018f01 3401ba00 b0002f01 dd006500 1b001600 19005800 a300f700 7d01ae01 55016201 4701ca00 bd001d01 22024a01 94003000 2e008e00 9300da00 91016601 7900de00 6701bb00 b800b200 91029a02 ad025702 8c01f000 c1005c01 6d01f300 33003500 b600c500 b100ba00 94029e02 90025d02 36021602 57016f01 5901a000 35002e00 8700aa00 b0009c00 a602ad02 aa02a501 dd01b001 2e025401 4901a600 39003300 9000bb00 be00a600 b402ba02 85022502 ea01b501 b2013b01 a201ef00 35003a00 e500b700 d9008100 6b02f801 e4010802 6c012b01 dd014a01 6c010b01 7f00a800 4101d500 cc008100 dc017f01 9001d501 1f01d900 e7016b01 0501c900 bf00f900 4a01ed00 97009700 c7019001 b601d501 44013001 bd01a701 fd00ca00 d400f200 2e01ef00 7100a100 e7019401 9f01ce01 5b01af01 0002ad01 f400b300 d700f200 1101ec00 76009d00 22029a01 7801e901 7701a401 2502a201 e5008e00 d800f000 1601ee00 9c009e00 8c024802 50025d02 a401d801 3a026e01 c5007800 ef00f900 1d010c01 c500a000 8f027b02 11026502 f901c101 1c021f01 bd00b800 20010301 1d014201 dd00a600 8e029202 95029802 5702f701 b3013601 3101c600 5d011a01 26015001 f600a900>;
3 = {
epoch = 0;
flags = 1;
timescale = 1000000000;
value = 152614539514916;
};
4 = 1;
5 = 226;
6 = 212;
7 = 1;
8 = (
"-0.02239176",
"-0.722497",
"-0.7173175"
);
9 = 275;
}, Depth: 8, Orientation: 6, {GPS}: {
Altitude = "37.24049331963001";
AltitudeRef = 0;
DateStamp = "2014:12:21";
DestBearing = "48.13050314465409";
DestBearingRef = T;
ImgDirection = "228.1305031446541";
ImgDirectionRef = T;
Latitude = "35.691905";
LatitudeRef = N;
Longitude = "139.6862333333333";
LongitudeRef = E;
Speed = 0;
SpeedRef = K;
TimeStamp = "01:34:45";
}, DPIHeight: 72]
[PixelHeight: 2048, ColorModel: RGB, HasAlpha: 1, {PNG}: {
Chromaticities = (
"0.3127",
"0.329",
"0.64",
"0.33",
"0.3",
"0.6",
"0.15",
"0.06"
);
Gamma = "0.45455";
InterlaceType = 0;
sRGBIntent = 0;
}, PixelWidth: 1448, Depth: 8]
[PixelHeight: 1136, ColorModel: RGB, {PNG}: {
Chromaticities = (
"0.3127",
"0.329",
"0.64",
"0.33",
"0.3",
"0.6",
"0.15",
"0.06"
);
Gamma = "0.45455";
InterlaceType = 0;
sRGBIntent = 0;
}, PixelWidth: 640, Depth: 8]
2枚目 webにあったのを保存したもの
[PixelHeight: 1136, ColorModel: RGB, {PNG}: {
Chromaticities = (
"0.3127",
"0.329",
"0.64",
"0.33",
"0.3",
"0.6",
"0.15",
"0.06"
);
Gamma = "0.45455";
InterlaceType = 0;
sRGBIntent = 0;
}, PixelWidth: 640, Depth: 8]
3枚目 スクショ
0
[PixelHeight: 1136, ColorModel: RGB, {PNG}: {
Chromaticities = (
"0.3127",
"0.329",
"0.64",
"0.33",
"0.3",
"0.6",
"0.15",
"0.06"
);
Gamma = "0.45455";
InterlaceType = 0;
sRGBIntent = 0;
}, PixelWidth: 640, Depth: 8]