0

When I am uploading an image via smartphone, I am losing my GPS exif data.

Any idea how to upload with GPS exif?

if(isset($_FILES['fupload'])) {

  if(preg_match('/[.](jpg)|(gif)|(png)$/', $_FILES['fupload']['name'])) {

    $filename = $_FILES['fupload']['name'];
    $source = $_FILES['fupload']['tmp_name'];  
    $date = date_create();
    $date = date_timestamp_get($date); 
    $target = $path_to_image_directory . $date . '_' . $filename;

    move_uploaded_file($source, $target);
  }
}
Grant Miller
  • 27,532
  • 16
  • 147
  • 165
  • are you uploading from an iPhone? there's a known bug (or feature, depending on who you ask) on iOS devices in which some image exif data is stripped from the image when uploading from the iOS device), see https://stackoverflow.com/questions/16297730/image-upload-from-iphone-strips-exif-data – Javier Larroulet Sep 27 '18 at 17:23
  • And this may help you also https://stackoverflow.com/questions/44928092/android-uploading-image-without-losing-exif-data – RiggsFolly Sep 27 '18 at 17:32
  • uploading via Samsung Android – stien develtere Sep 27 '18 at 18:15
  • For now I am reading out the exif data from $_FILES['fupload']['name'] and saving the data in a var. With a perl script I readd the exif data to the uploaded image – stien develtere Sep 28 '18 at 14:03

0 Answers0