File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -215,14 +215,14 @@ public function mapRawData(array $data)
215
215
$ value = $ this ->extractGPSCoordinates ($ value );
216
216
break ;
217
217
case self ::GPSLATITUDE :
218
- $ latitudeRef = empty ($ data ['GPS:GPSLatitudeRef ' ]) ? 'N ' : $ data ['GPS:GPSLatitudeRef ' ];
218
+ $ latitudeRef = empty ($ data ['GPS:GPSLatitudeRef ' ]) ? 'N ' : $ data ['GPS:GPSLatitudeRef ' ][ 0 ] ;
219
219
$ value = (strtoupper ($ latitudeRef ) === 'S ' ? -1.0 : 1.0 )*$ this ->extractGPSCoordinates ($ value );
220
220
break ;
221
221
case self ::GPSLONGITUDE_QUICKTIME :
222
222
$ value = $ this ->extractGPSCoordinates ($ value );
223
223
break ;
224
224
case self ::GPSLONGITUDE :
225
- $ longitudeRef = empty ($ data ['GPS:GPSLongitudeRef ' ]) ? 'E ' : $ data ['GPS:GPSLongitudeRef ' ];
225
+ $ longitudeRef = empty ($ data ['GPS:GPSLongitudeRef ' ]) ? 'E ' : $ data ['GPS:GPSLongitudeRef ' ][ 0 ] ;
226
226
$ value = (strtoupper ($ longitudeRef ) === 'W ' ? -1 : 1 ) * $ this ->extractGPSCoordinates ($ value );
227
227
break ;
228
228
case self ::GPSALTITUDE :
@@ -289,7 +289,7 @@ public function mapRawData(array $data)
289
289
*/
290
290
protected function extractGPSCoordinates ($ coordinates )
291
291
{
292
- if (is_numeric ($ coordinates ) === true ) {
292
+ if (is_numeric ($ coordinates ) === true or $ this -> numeric === true ) { ) {
293
293
return ((float ) $ coordinates );
294
294
} else {
295
295
if (!preg_match ('!^([0-9.]+) deg ([0-9.]+) \' ([0-9.]+)"! ' , $ coordinates , $ matches )) {
Original file line number Diff line number Diff line change @@ -206,14 +206,12 @@ public function mapRawData(array $data)
206
206
$ value = (int ) reset ($ resolutionParts );
207
207
break ;
208
208
case self ::GPSLATITUDE :
209
- if (!(empty ($ data ['GPSLatitudeRef ' ][0 ]))) {
210
- $ value = $ this ->extractGPSCoordinate ($ value , $ data ['GPSLatitudeRef ' ][0 ]);
211
- }
209
+ $ GPSLatitudeRef = (!(empty ($ data ['GPSLatitudeRef ' ][0 ]))) ? $ data ['GPSLatitudeRef ' ][0 ] : '' ;
210
+ $ value = $ this ->extractGPSCoordinate ((array )$ value , $ GPSLatitudeRef );
212
211
break ;
213
212
case self ::GPSLONGITUDE :
214
- if (!(empty ($ data ['GPSLongitudeRef ' ][0 ]))) {
215
- $ value = $ this ->extractGPSCoordinate ($ value , $ data ['GPSLongitudeRef ' ][0 ]);
216
- }
213
+ $ GPSLongitudeRef = (!(empty ($ data ['GPSLongitudeRef ' ][0 ]))) ? $ data ['GPSLongitudeRef ' ][0 ] : '' ;
214
+ $ value = $ this ->extractGPSCoordinate ((array )$ value , $ GPSLongitudeRef );
217
215
break ;
218
216
case self ::GPSALTITUDE :
219
217
$ flip = 1 ;
@@ -298,6 +296,7 @@ protected function isFieldKnown(&$field)
298
296
*/
299
297
protected function extractGPSCoordinate (array $ coordinate , string $ ref )
300
298
{
299
+
301
300
$ degrees = count ($ coordinate ) > 0 ? $ this ->normalizeComponent ($ coordinate [0 ]) : 0 ;
302
301
$ minutes = count ($ coordinate ) > 1 ? $ this ->normalizeComponent ($ coordinate [1 ]) : 0 ;
303
302
$ seconds = count ($ coordinate ) > 2 ? $ this ->normalizeComponent ($ coordinate [2 ]) : 0 ;
You can’t perform that action at this time.
0 commit comments