質問編集履歴
3
コード改変
title
CHANGED
File without changes
|
body
CHANGED
@@ -65,4 +65,29 @@
|
|
65
65
|
}
|
66
66
|
```
|
67
67
|

|
68
|
-

|
68
|
+

|
69
|
+
|
70
|
+
コード改変
|
71
|
+
|
72
|
+
```
|
73
|
+
import UIKit
|
74
|
+
import PlaygroundSupport
|
75
|
+
|
76
|
+
let fileUrl = Bundle.main.url(forResource: "test", withExtension: "jpg")
|
77
|
+
let image = UIImage(named:"test.jpg")!
|
78
|
+
|
79
|
+
//let fileUrl = PlaygroundSupport.playgroundSharedDataDirectory.appendingPathComponent("test.jpg")
|
80
|
+
//let image = UIImage(contentsOfFile: fileUrl.absoluteString)
|
81
|
+
|
82
|
+
// 以下を該当箇所にコピペすれば良さそうです。
|
83
|
+
let options = [kCGImageSourceShouldCache as String: kCFBooleanFalse]
|
84
|
+
if let data = NSData(contentsOf: fileUrl!), let imgSrc = CGImageSourceCreateWithData(data, options as CFDictionary) {
|
85
|
+
let metadata = CGImageSourceCopyPropertiesAtIndex(imgSrc, 0, options as CFDictionary) as? [String : AnyObject]
|
86
|
+
if let gpsData = metadata?[kCGImagePropertyGPSDictionary as String] {
|
87
|
+
print(gpsData)
|
88
|
+
} else {
|
89
|
+
print("GPS Data load failed...")
|
90
|
+
}
|
91
|
+
}
|
92
|
+
```
|
93
|
+

|
2
画像の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -63,4 +63,6 @@
|
|
63
63
|
|
64
64
|
|
65
65
|
}
|
66
|
-
```
|
66
|
+
```
|
67
|
+

|
68
|
+

|
1
質問の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,8 +4,9 @@
|
|
4
4
|
exifデータはprintできたので取得できています。しかし、GPS情報(dopや衛星数)が取得できない。
|
5
5
|
◎聞きたいこと
|
6
6
|
リファレンスに```kCGImagePropertyGPSDictionary```があったので記録されているものと思っていましたが、そもそもGPS情報(dopや衛星数)は写真を撮ったときに記録されていないのでしょうか?
|
7
|
+
◎kCGImagePropertyExifDictionaryの呼出し方(使い方)は正しいか?
|
7
8
|
|
8
|
-
|
9
|
+
ファレンスのURL
|
9
10
|
CGImage プロパティ
|
10
11
|
https://developer.apple.com/documentation/imageio/cgimageproperties
|
11
12
|
|