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)
215215 $ value = $ this ->extractGPSCoordinates ($ value );
216216 break ;
217217 case self ::GPSLATITUDE :
218- $ latitudeRef = empty ($ data ['GPS:GPSLatitudeRef ' ]) ? 'N ' : $ data ['GPS:GPSLatitudeRef ' ];
218+ $ latitudeRef = empty ($ data ['GPS:GPSLatitudeRef ' ]) ? 'N ' : $ data ['GPS:GPSLatitudeRef ' ][ 0 ] ;
219219 $ value = (strtoupper ($ latitudeRef ) === 'S ' ? -1.0 : 1.0 )*$ this ->extractGPSCoordinates ($ value );
220220 break ;
221221 case self ::GPSLONGITUDE_QUICKTIME :
222222 $ value = $ this ->extractGPSCoordinates ($ value );
223223 break ;
224224 case self ::GPSLONGITUDE :
225- $ longitudeRef = empty ($ data ['GPS:GPSLongitudeRef ' ]) ? 'E ' : $ data ['GPS:GPSLongitudeRef ' ];
225+ $ longitudeRef = empty ($ data ['GPS:GPSLongitudeRef ' ]) ? 'E ' : $ data ['GPS:GPSLongitudeRef ' ][ 0 ] ;
226226 $ value = (strtoupper ($ longitudeRef ) === 'W ' ? -1 : 1 ) * $ this ->extractGPSCoordinates ($ value );
227227 break ;
228228 case self ::GPSALTITUDE :
@@ -289,7 +289,7 @@ public function mapRawData(array $data)
289289 */
290290 protected function extractGPSCoordinates ($ coordinates )
291291 {
292- if (is_numeric ($ coordinates ) === true ) {
292+ if (is_numeric ($ coordinates ) === true or $ this -> numeric === true ) { ) {
293293 return ((float ) $ coordinates );
294294 } else {
295295 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)
206206 $ value = (int ) reset ($ resolutionParts );
207207 break ;
208208 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 );
212211 break ;
213212 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 );
217215 break ;
218216 case self ::GPSALTITUDE :
219217 $ flip = 1 ;
@@ -298,6 +296,7 @@ protected function isFieldKnown(&$field)
298296 */
299297 protected function extractGPSCoordinate (array $ coordinate , string $ ref )
300298 {
299+
301300 $ degrees = count ($ coordinate ) > 0 ? $ this ->normalizeComponent ($ coordinate [0 ]) : 0 ;
302301 $ minutes = count ($ coordinate ) > 1 ? $ this ->normalizeComponent ($ coordinate [1 ]) : 0 ;
303302 $ seconds = count ($ coordinate ) > 2 ? $ this ->normalizeComponent ($ coordinate [2 ]) : 0 ;
You can’t perform that action at this time.
0 commit comments