media: Remove pass-by-ref in Exif::exifGPStoNumber
Use coalesce operator to check if the array key exists Change-Id: Icf24e208a487bafe3d1983536870aac19cfc4b5e (cherry picked from commit f0ad539b4e613216639b04386f56d6bb1b656d14)
This commit is contained in:
parent
30ae82e2b2
commit
bce244403c
1 changed files with 3 additions and 5 deletions
|
|
@ -643,13 +643,11 @@ class Exif {
|
|||
* @param string $prop A GPS coordinate exif tag name (like GPSLongitude)
|
||||
*/
|
||||
private function exifGPStoNumber( $prop ) {
|
||||
$loc =& $this->mFilteredExifData[$prop];
|
||||
$dir =& $this->mFilteredExifData[$prop . 'Ref'];
|
||||
$loc = $this->mFilteredExifData[$prop] ?? null;
|
||||
$dir = $this->mFilteredExifData[$prop . 'Ref'] ?? null;
|
||||
$res = false;
|
||||
|
||||
if ( isset( $loc ) && isset( $dir )
|
||||
&& ( $dir === 'N' || $dir === 'S' || $dir === 'E' || $dir === 'W' )
|
||||
) {
|
||||
if ( $loc !== null && ( $dir === 'N' || $dir === 'S' || $dir === 'E' || $dir === 'W' ) ) {
|
||||
[ $num, $denom ] = explode( '/', $loc[0], 2 );
|
||||
$res = (int)$num / (int)$denom;
|
||||
[ $num, $denom ] = explode( '/', $loc[1], 2 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue