File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,13 @@ public function mapRawData(array $data)
163163
164164 // add GPS coordinates, if available
165165 if (count ($ gpsData ) === 2 && $ gpsData ['lat ' ] !== false && $ gpsData ['lon ' ] !== false ) {
166+ $ latitudeRef = isset ($ data ['GPSLatitudeRef ' ][0 ]) ? $ data ['GPSLatitudeRef ' ][0 ] : null ;
167+ $ longitudeRef = isset ($ data ['GPSLongitudeRef ' ][0 ]) ? $ data ['GPSLongitudeRef ' ][0 ] : null ;
168+
166169 $ gpsLocation = sprintf (
167170 '%s,%s ' ,
168- (isset ( $ data [ ' GPSLatitudeRef ' ][ 0 ]) && strtoupper ($ data [ ' GPSLatitudeRef ' ][ 0 ] ) === 'S ' ? -1 : 1 ) * $ gpsData ['lat ' ],
169- (isset ( $ data [ ' GPSLongitudeRef ' ][ 0 ]) && strtoupper ($ data [ ' GPSLongitudeRef ' ][ 0 ] ) === 'W ' ? -1 : 1 ) * $ gpsData ['lon ' ]
171+ (strtoupper ($ latitudeRef ) === 'S ' ? -1 : 1 ) * $ gpsData ['lat ' ],
172+ (strtoupper ($ longitudeRef ) === 'W ' ? -1 : 1 ) * $ gpsData ['lon ' ]
170173 );
171174
172175 $ mappedData [Exif::GPS ] = $ gpsLocation ;
Original file line number Diff line number Diff line change @@ -181,10 +181,13 @@ public function mapRawData(array $data)
181181
182182 // add GPS coordinates, if available
183183 if (count ($ gpsData ) === 2 ) {
184+ $ latitudeRef = isset ($ data ['GPSLatitudeRef ' ][0 ]) ? $ data ['GPSLatitudeRef ' ][0 ] : null ;
185+ $ longitudeRef = isset ($ data ['GPSLongitudeRef ' ][0 ]) ? $ data ['GPSLongitudeRef ' ][0 ] : null ;
186+
184187 $ gpsLocation = sprintf (
185188 '%s,%s ' ,
186- (isset ( $ data [ ' GPSLatitudeRef ' ][ 0 ]) && strtoupper ($ data [ ' GPSLatitudeRef ' ][ 0 ] ) === 'S ' ? -1 : 1 ) * $ gpsData ['lat ' ],
187- (isset ( $ data [ ' GPSLongitudeRef ' ][ 0 ]) && strtoupper ($ data [ ' GPSLongitudeRef ' ][ 0 ] ) === 'W ' ? -1 : 1 ) * $ gpsData ['lon ' ]
189+ (strtoupper ($ latitudeRef ) === 'S ' ? -1 : 1 ) * $ gpsData ['lat ' ],
190+ (strtoupper ($ longitudeRef ) === 'W ' ? -1 : 1 ) * $ gpsData ['lon ' ]
188191 );
189192
190193 $ mappedData [Exif::GPS ] = $ gpsLocation ;
You can’t perform that action at this time.
0 commit comments