Closed
Description
Hello community,
I read that on older php versions exif read function was not working properly on certain images.
I should have been patched with new php versions... But not fully...
On recent DJI images, I have a persistent uncapacity to correctly "read exif data" from image
here an example of errors I have:
Please note that with other images, it works like a charm. And not problem for me to extract data.
Here is my code:
`//get the EXIF
$exif = exif_read_data($file, 'IFD0');
echo $exif===false ? "Aucun en-tête de donnés n'a été trouvé.
\n" : "L'image contient des en-têtes
\n";
$exif = exif_read_data($file);
//get the Hemisphere multiplier
$LatM = 1;
$LongM = 1;
if($exif["GPSLatitudeRef"] == 'S')
{
$LatM = -1;
}
if($exif["GPSLongitudeRef"] == 'W')
{
$LongM = -1;
}
$alt = explode('/', $exif["GPSAltitude"]);
$altitude = (isset($alt[1])) ? ($alt[0] / $alt[1]) : $alt[0];
//get the GPS data
$gps['LatDegree']=$exif["GPSLatitude"][0];
$gps['LatMinute']=$exif["GPSLatitude"][1];
$gps['LatgSeconds']=$exif["GPSLatitude"][2];
$gps['LongDegree']=$exif["GPSLongitude"][0];
$gps['LongMinute']=$exif["GPSLongitude"][1];
$gps['LongSeconds']=$exif["GPSLongitude"][2];`