{"id":74940,"date":"2026-10-10T03:01:00","date_gmt":"2026-10-09T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=74940"},"modified":"2026-10-07T20:27:47","modified_gmt":"2026-10-07T10:27:47","slug":"php-exif-retention-off-iphone-images-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-retention-off-iphone-images-tutorial\/","title":{"rendered":"PHP Exif Retention off iPhone Images Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_makeover_more.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Retention off iPhone Images Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_makeover_more.gif\" title=\"PHP Exif Retention off iPhone Images Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Retention off iPhone Images Tutorial<\/p><\/div>\n<p>We have a new project on the go.  We want to retain <a target=\"_blank\" title='Exif information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Exif' rel=\"noopener\">Exif<\/a> information, that is contained within our iPhone&#8217;s *.HEIC formatted photographs, all the way through to some format and form of RJM Programming public website set of image media files.<\/p>\n<p>And so, as well as referencing previous work such as that of <a title='PHP Exif Image Information Revisit Tutorial' href='#phpeiirt'>PHP Exif Image Information Revisit Tutorial<\/a> and <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/command-line-imagemagick-heic-to-jpeg-image-creation-tutorial\/' title='Command Line ImageMagick HEIC to JPEG Image Creation Tutorial' rel=\"noopener\">Command Line ImageMagick HEIC to JPEG Image Creation Tutorial<\/a>, we asked of Google <a target=\"_blank\" title='retaining exif information of iPhone images all the way to uploading via filezilla to a web server' href='https:\/\/www.google.com\/search?q=retaining+exif+information+of+iPhone+images+all+the+way+to+uploading+via+filezilla+to+a+web+server&#038;sca_esv=b1234865c858a64b&#038;rlz=1C5OZZY_en&#038;sxsrf=APpeQnuwh1Q1s8SXwneQAGo86FuZgNyqgA%3A1791346972589&#038;ei=HMnFar-0I6Grvr0PuaCZ4Ag&#038;biw=1561&#038;bih=778&#038;uact=5&#038;oq=retaining+exif+information+of+iPhone+images+all+the+way+to+uploading+via+filezilla+to+a+web+server&#038;gs_lp=Egxnd3Mtd2l6LXNlcnAiYnJldGFpbmluZyBleGlmIGluZm9ybWF0aW9uIG9mIGlQaG9uZSBpbWFnZXMgYWxsIHRoZSB3YXkgdG8gdXBsb2FkaW5nIHZpYSBmaWxlemlsbGEgdG8gYSB3ZWIgc2VydmVySIMnUNoIWMQkcAF4AZABAJgBowKgAYMWqgEFMC41Lji4AQPIAQD4AQGYAgOgAuADwgIKEAAYRxjWBBiwA8ICBxAjGLACGCfCAgQQIRgKmAMAiAYBkAYIkgcFMS4wLjKgB8kbsgcDMi0yuAfXA8IHBzAuMS4xLjHIBxOACAE&#038;sclient=gws-wiz-serp' rel=\"noopener\">retaining exif information of iPhone images all the way to uploading via filezilla to a web server<\/a>, finding pertinent and useful the advice &#8230;<\/p>\n<blockquote cite='https:\/\/www.google.com\/search?q=retaining+exif+information+of+iPhone+images+all+the+way+to+uploading+via+filezilla+to+a+web+server&#038;sca_esv=b1234865c858a64b&#038;rlz=1C5OZZY_en&#038;sxsrf=APpeQnuwh1Q1s8SXwneQAGo86FuZgNyqgA%3A1791346972589&#038;ei=HMnFar-0I6Grvr0PuaCZ4Ag&#038;biw=1561&#038;bih=778&#038;uact=5&#038;oq=retaining+exif+information+of+iPhone+images+all+the+way+to+uploading+via+filezilla+to+a+web+server&#038;gs_lp=Egxnd3Mtd2l6LXNlcnAiYnJldGFpbmluZyBleGlmIGluZm9ybWF0aW9uIG9mIGlQaG9uZSBpbWFnZXMgYWxsIHRoZSB3YXkgdG8gdXBsb2FkaW5nIHZpYSBmaWxlemlsbGEgdG8gYSB3ZWIgc2VydmVySIMnUNoIWMQkcAF4AZABAJgBowKgAYMWqgEFMC41Lji4AQPIAQD4AQGYAgOgAuADwgIKEAAYRxjWBBiwA8ICBxAjGLACGCfCAgQQIRgKmAMAiAYBkAYIkgcFMS4wLjKgB8kbsgcDMi0yuAfXA8IHBzAuMS4xLjHIBxOACAE&#038;sclient=gws-wiz-serp'><p>\nTo retain EXIF data from an iPhone all the way to a web server via FileZilla, you must bypass mobile browser compression and ensure lossless transfer protocols.<\/p>\n<p>AirDrop or Cable Transfer: Transfer the file from the Files app or Photos library to a Mac or PC using AirDrop or a direct USB cable.\n<\/p><\/blockquote>\n<p>And so, that is today&#8217;s first step on the new project, where if we cannot retain Exif the project is not worth continuing with.<\/p>\n<p>Keep your hair on!  It worked using our <a target=\"_blank\" title='ImageMagick command line' href='http:\/\/www.imagemagick.org\/script\/command-line-tools.php' rel=\"noopener\">ImageMagick<\/a> conversions to *.jpeG (from iPhone <a target=\"_blank\" title='AirDrop information from Apple' href='https:\/\/support.apple.com\/en-au\/HT204144' rel=\"noopener\">AirDrop<\/a><sup>ped<\/sup> *.HEIC) here on this MacBook Air and <a target=\"_blank\" title='FileZilla sftp\/ftp' href='https:\/\/filezilla-project.org\/' rel=\"noopener\">FileZilla<\/a> (<a target=\"_blank\" title='sftp information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/SSH_File_Transfer_Protocol' rel=\"noopener\">sftp<\/a>) uploading those to our new folder on the RJM Programming web server for images like &#8230;<\/p>\n<p><img src='\/NZ\/IMG_4495.jpeG'><\/img>  <\/p>\n<p> &#8230; as one example.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/new-php-exif-image-information-revisit-tutorial\/' rel=\"noopener\">New PHP Exif Image Information Revisit Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpeiirt'>Previous relevant <a target=\"_blank\" title='PHP Exif Image Information Revisit Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-image-information-revisit-tutorial\/' rel=\"noopener\">PHP Exif Image Information Revisit Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=HTTP:\/\/www.rjmprogramming.com.au\/streetart\/images\/DSC_0364.jpg\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Image Information Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_makeover.jpg\" title=\"PHP Exif Image Information Revisit Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Image Information Revisit Tutorial<\/p><\/div>\n<p>Another &#8220;revisit&#8221; today to the PHP Exif Information web application displayer of <a title='PHP Exif Image Zip Mystery Game Hints Tutorial' href='#phpeizmght'>PHP Exif Image Zip Mystery Game Hints Tutorial<\/a>.  Now supposing we put this scenario to you &#8230;<\/p>\n<ul>\n<li>you are working in PHP &#8230; ie. you have to work in a serverside &#8220;something&#8221; for the purposes of Exif work &#8230;<\/li>\n<li>your webpage has a top header bit that goes the full way across the webpage &#8230; and &#8230;<\/p>\n<li>your webpage has a one line form footer bit that goes the full way across the webpage &#8230; and &#8230;<\/p>\n<li>between that you want to display &#8230;\n<ol>\n<li>Exif textual information &#8230; and &#8230;<\/li>\n<li>the image that the Exif is talking about, and we want it (as an improvement for today&#8217;s work) &#8230;\n<ul>\n<li>proportional (ie. retain the image&#8217;s original aspect ratio)<\/li>\n<li>not repeated<\/li>\n<li>above the fold<\/li>\n<li>fully shown<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>Now we ask you, in PHP, do you need to know the dimensions of that image to satisfy the requirements above?   Well, we first thought (surely it must be) so, but going through the motions of doing today&#8217;s work, we realized that, though you can (for the PHP global $image variable with the image URL) &#8230;<\/p>\n<p><code><br \/>\n  list($width, $height, $type, $attr) = getimagesize($image);<br \/>\n<\/code><\/p>\n<p> &#8230; in PHP to determine those image dimensions, with the way our web application works, we didn&#8217;t need to, as you can &#8220;link&#8221; PHP with the CSS <a target=\"_blank\" title='CSS3 calc information' href='https:\/\/www.htmlgoodies.com\/html5\/css\/using-the-css3-calc-function.html' rel=\"noopener\">calc<\/a> function to bypass any Javascript (eg. DOM) client script approach, abstracting the need to know hard and fast dimensions in PHP (and consequently not running into any window resizing or zooming issues <font size=2>(as a matter of fact, zooming up can make the Exif text information resize up quite nicely<\/font> <font size=1>thank you very much<\/font> <font size=2>and don&#8217;t mind if I do<\/font> <\/font size=1>but we digress and so<\/font> <font size=2 color=blue>and usefully)<\/font>)<\/p>\n<p><code><br \/>\nif ($image != \"\") {<br \/>\n  list($width, $height, $type, $attr) = <a target=\"_blank\" title='PHP getimagesize function' href='https:\/\/www.php.net\/manual\/en\/function.getimagesize.php' rel=\"noopener\">getimagesize<\/a>($image);<br \/>\n  \/\/ $iwidth=$width;<br \/>\n  \/\/ $iheight=$height;<br \/>\n  \/\/ $csswh=\" width:\" . $iwidth . \"px; height:\" . $iheight . \"px; \";<br \/>\n  <font color=blue>$csswh=\" width: calc(100% - 10px); height: calc(100% - 220px); <font color=green>text-align: right;<\/font> margin-right: 20px;  } form { position: absolute; left:50px; top: calc(100% - 45px); width:100%; height:40px; \";<\/font><br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; used later on to build up the HTML for the webpage, that also looks much better because the image and Exif wording <font color=green>are more likely to be separated from each other now<\/font> &#8230;<\/p>\n<p><code><br \/>\n$htmlis=\"&lt;html&gt;&lt;head&gt;\" . $javascript . \"&lt;style&gt;\" . $bcsscolour . \" div { font-size:9px; overflow: visible; float:right; \" . $csswh . \" } &lt;\/style&gt;&lt;meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.25, maximum-scale=8, user-scalable=yes'&gt;&lt;title&gt;Exif for \" . $image . \"&lt;\/title&gt;&lt;\/head&gt;&lt;body style='background-color:\" . $bcolour . \";'&gt;&lt;h1 id='myh1'&gt;Exif &lt;select onchange=\\\"if (this.value.length == 2) { top.alinktop=''; top.document.getElementById('dexif').innerHTML=''; top.location.href=top.document.URL.split('index.')[0]+'index-ssmhalf.html';  } else { var zipurl=prompt('Enter image zipfile URL for Mystery Trip game (good for 2 players)','mysterytrip.zip'); if (zipurl != null) { if (zipurl.toLowerCase().indexOf('.zip') != -1) { location.href=document.URL.split('#')[0].split('?')[0] + '?image=' + encodeURIComponent(zipurl);  } } } \\\"&gt;&lt;option value=''&gt;for&lt;\/option&gt;&lt;option value=' '&gt;zipfile&lt;\/option&gt;\" . $anotheroption . \"&lt;\/select&gt; \" . $image . \"&lt;\/h1&gt;&lt;h3&gt;RJM Programming - August, 2016  &lt;a id='ageolocation style='visibility:hidden;' href='#mygeolocation'&gt;Geolocation Context for Photograph\" . $various . \"&lt;\/a&gt;&lt;\/h3&gt;&lt;h4&gt;Thanks to &lt;a target=_blank title=Useful href=\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data&gt;http:\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data&lt;\/a&gt;&lt;\/h4&gt;&lt;div onclick=\\\"window.open('\" . $image . \"','_blank','top=5,left=5');\\\" style='background-color:yellow; background: url(\" . str_replace(\"\/Applications\/MAMP\/htdocs\/\",\"http:\/\/localhost:8888\/\",$image) . \") no-repeat; background-position: 5px; background-size: contain;  '&gt;&lt;br&gt;\" . \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Image type of \" . $image . \" is: \" . $types[$imagetype];<br \/>\n<\/code><\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php------GETME\" rel=\"noopener\">changed PHP<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php------GETME\" rel=\"noopener\">read_exif_off_image_rotate.php<\/a> includes these aesthetic and usability improvements you can test for yourself at this <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php\" title=\"Click picture\" rel=\"noopener\">live run<\/a> link.<\/p>\n<hr>\n<p id='phpeizmght'>Previous relevant <a target=\"_blank\" title='PHP Exif Image Zip Mystery Game Hints Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-image-zip-mystery-game-hints-tutorial\/' rel=\"noopener\">PHP Exif Image Zip Mystery Game Hints Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=mysterytrip.zip\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Image Zip Mystery Game Hints Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_mystery_clues.jpg\" title=\"PHP Exif Image Zip Mystery Game Hints Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Image Zip Mystery Game Hints Tutorial<\/p><\/div>\n<p>Just like with the recent <a target=\"_blank\" title='PHP Wikipedia Geo Map Google Chart Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-wikipedia-geo-map-google-chart-tutorial\/' rel=\"noopener\">PHP Wikipedia Geo Map Google Chart Tutorial<\/a> we find a use for the talents of <a target=\"_blank\" href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.' rel=\"noopener\">Google Chart<\/a> &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='Google Chart Map Chart information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/map' rel=\"noopener\">Map Chart<\/a><\/li>\n<li><a target=\"_blank\" href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/geochart' title='Google Geo Charts' rel=\"noopener\">Geo Chart<\/a><\/li>\n<\/ul>\n<p> &#8230; as we improve the functionality of our &#8220;Mystery Trip in Images Game&#8221; we started with yesterday&#8217;s <a title='PHP Exif Image Zip Mystery Game Primer Tutorial' href='#phpeizmgpt'>PHP Exif Image Zip Mystery Game Primer Tutorial<\/a>.<\/p>\n<p>They are used respectively for &#8230;<\/p>\n<ul>\n<li>final view of a map of the trip after the second player has finished their guessing of Start and Finish place characteristics (as we also do with another <a target=\"_blank\" title='Google Maps' href='http:\/\/maps.google.com' rel=\"noopener\">Google Maps<\/a> window, thanks, that gives directions between two (latitude, longitude) sets)<\/li>\n<li>as a mechanism to provide a hint (that is not totally obvious, and thereby giving the game away)<\/li>\n<\/ul>\n<p>And so today we can take you to a real zip file of JPEG images of a Mystery Trip, taken on an iPhone that you can try with a second player at this <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=mysterytrip.zip\" title=\"Click picture\" rel=\"noopener\">live run<\/a> link.<\/p>\n<p>The photos were taken deliberately to be obtuse, so as not to give the game away with their visual content.  How are we able to give you hints in a programmatical sense?  Well, on a JPEG coming out of an iPhone there is geodata (metadata latitude and longitude) stored that we access via Exif image attribute (PHP) methods.<\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php-----GETME\" rel=\"noopener\">changed PHP<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php-----GETME\" rel=\"noopener\">read_exif_off_image_rotate.php<\/a> includes these &#8220;best for two player&#8221; game interactive improvements, as well as allowing the user be able to reach this Mystery Game from old URL (simpler) arrangements, from older incarnations (you can read below).<\/p>\n<hr>\n<p id='phpeizmgpt'>Previous relevant <a target=\"_blank\" title='PHP Exif Image Zip Mystery Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-image-zip-mystery-game-primer-tutorial\/' rel=\"noopener\">PHP Exif Image Zip Mystery Game Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?mystery=y\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Image Zip Mystery Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_mystery.jpg\" title=\"PHP Exif Image Zip Mystery Game Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Image Zip Mystery Game Primer Tutorial<\/p><\/div>\n<p>There&#8217;s a fair bit to the design of a new game we&#8217;re developing that uses the image metadata ideas from <a title='PHP Exif Image Information Rotation Tutorial' href='#phpeiirt'>PHP Exif Image Information Rotation Tutorial<\/a> in its workings.<\/p>\n<p>Our early days work starts down the road by collecting <a target=\"_blank\" title='PHP zip_open' href='http:\/\/php.net\/manual\/en\/function.zip-open.php' rel=\"noopener\">zipfile<\/a> and other pertinent Exif data item ideas off &#8230;<\/p>\n<ul>\n<li>first game player, who sets up the game parameters while player 2 is not watching, in a form that is submitted ahead of &#8230;<\/li>\n<li>second player then turns around and tries to guess details of a Start place and End place, and any other places photographed by player 1<\/li>\n<\/ul>\n<p>As you can see to simplify things we are introducing PHP zipfile coding to group together a set of photographs into the one file concept.<\/p>\n<p>It will be tomorrow that you see a more complete and rounded game solution, and by then we can come up with a name for it too!<\/p>\n<p>Feel free to try <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php----GETME\" rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php----GETME\" rel=\"noopener\">read_exif_off_image_rotate.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?mystery=y\" rel=\"noopener\">live run<\/a> to try out this game in an early incarnation.<\/p>\n<hr>\n<p id='phpeiirt'>Previous relevant <a target=\"_blank\" title='PHP Exif Image Information Rotation Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-image-information-rotation-tutorial\/' rel=\"noopener\">PHP Exif Image Information Rotation Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=http:\/\/www.rjmprogramming.com.au\/Mindfulness\/clouds.jpg\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Image Information Rotation Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_followup.jpg\" title=\"PHP Exif Image Information Rotation Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Image Information Rotation Tutorial<\/p><\/div>\n<p>The &#8220;Stop Press&#8221; of <a title='PHP Exif Image Information Primer Tutorial' href='#peiipt'>PHP Exif Image Information Primer Tutorial<\/a> as shown below, introduced us to some PHP able to glean quite a bit of really useful Exif information stored with an image file, perhaps straight off a digital camera or mobile phone or mobile tablet.  We use the great advice of <a target=\"_blank\" title=\"Useful\" href=\"http:\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data\" rel=\"noopener\">http:\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data<\/a> to cycle through this information.<\/p>\n<p>This information was of interest regarding &#8230;<\/p>\n<blockquote><p>\nSometimes you&#8217;ll see <a target=\"_blank\" title='Gimp' href='http:\/\/gimp.org' rel=\"noopener\">Gimp<\/a> using exif functionality when it becomes aware of the possibility your image could be rotated to advantage\n<\/p><\/blockquote>\n<p> &#8230; as we saw Gimp doing this in relation to a photograph image coming off my Android Mobile Phone that we used, in its &#8220;rotated-by-Gimp&#8221; form, in our recent <a target=\"_blank\" title='Mindfulness Follow Up Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/mindfulness-follow-up-tutorial\/' rel=\"noopener\">Mindfulness Follow Up Tutorial<\/a>.  But how about if we want to detect what Gimp detects, to fix this camera orientation issue ourselves?  Well, in amongst the Exif information, we found &#8230;<\/p>\n<ul>\n<li><code>IFD0.Orientation: 6<\/code> &#8230; and then surfing the web we found &#8230;<\/li>\n<li><a target=\"_blank\" title='Useful link' href='http:\/\/www.impulseadventure.com\/photo\/exif-orientation.html' rel=\"noopener\">this useful link<\/a> explaining this Exif setting &#8230; thanks<\/li>\n<\/ul>\n<p> &#8230; which gave us the means to apply a rotation the way Gimp does.  How did we decide to apply this rotation?  There are lots of ways, and we decided on this occasion to use CSS and apply a background image, with a transformation, to an HTML div element, also showing all that Exif information.  We do this with new PHP you could call <a target=\"_blank\" title='read_exif_off_image_rotate.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php-GETME' rel=\"noopener\">read_exif_off_image_rotate.php<\/a> that has this corresponding new <a target=\"_blank\" title='Live Run' href='http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=http:\/\/www.rjmprogramming.com.au\/Mindfulness\/clouds.jpg' rel=\"noopener\">live run<\/a> link.  To get there, from where we&#8217;ve last been, take a skeg <a target=\"_blank\" title='read_exif_off_image_rotate.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php-GETME' rel=\"noopener\">here<\/a>.<\/p>\n<p>So, coming back to our &#8220;clouds&#8221; photo we saw an Exif IFD0.Orientation value of 6 and consulted <a target=\"_blank\" title='Useful link' href='http:\/\/www.impulseadventure.com\/photo\/exif-orientation.html' rel=\"noopener\">this useful link<\/a> to find that we should rotate the image by 90 degrees.  We do this with the HTML and inline CSS that goes, for the encasing HTML div element &#8230;<\/p>\n<p><code><br \/>\n&lt;div style='background-color:yellow; background: url(clouds.jpg); opacity:0.6;  norepeat; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); '&gt;<br \/>\n&lt;\/div&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; in regard to using the original camera image &#8230;<\/p>\n<p><img src='http:\/\/www.rjmprogramming.com.au\/Mindfulness\/clouds.jpg' width='100%'><\/img><\/p>\n<p>Now you may have heard of geographical knowledge stored within photographs, and perhaps you&#8217;ll see the <a target=\"_blank\" title='Live Run' href='http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image_rotate.php?image=http:\/\/www.rjmprogramming.com.au\/Mindfulness\/clouds.jpg' rel=\"noopener\">live run<\/a>&#8216;s (turn your head or computer) &#8230;<\/p>\n<p><code><br \/>\nGPS.GPSVersion<br \/>\n<\/code><\/p>\n<p> &#8230; that if fleshed out, with other data elements underneath, would put that image into the category of those where geographical information resides.  You may want to start reading more about (the huge topic of) &#8220;Geotagging&#8221; from this useful Wikipedia <a target=\"_blank\" title='Geotagged photograph information from Wikipedia' href='https:\/\/en.wikipedia.org\/wiki\/Geotagged_photograph' rel=\"noopener\">webpage<\/a> &#8230; thanks.<\/p>\n<hr>\n<p id='peiipt'>Previous relevant <a target=\"_blank\" title='PHP Exif Image Information Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-image-information-primer-tutorial\/' rel=\"noopener\">PHP Exif Image Information Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_tester.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Exif Image Information Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_primer.jpg\" title=\"PHP Exif Image Information Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Exif Image Information Primer Tutorial<\/p><\/div>\n<p>Our (Mac OS X laptop) local <a target=\"_blank\" href='https:\/\/www.mamp.info\/' title='MAMP Apache\/PHP\/MySql web server landing page' rel=\"noopener\">MAMP<\/a> web server is an Apache\/PHP\/MySql web server.  In this environment you can find out a lot with some PHP code as per &#8230;<\/p>\n<p><code>&lt;?php <a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/function.phpinfo.php' title='PHP phpinfo() method information' rel=\"noopener\">phpinfo();<\/a> ?&gt;<\/code><\/p>\n<p> &#8230; and if, in doing this, you find a reference to the <a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/book.exif.php' title='Exchangeable Image Information' rel=\"noopener\">&#8220;exif&#8221;<\/a> Exchangeable Image Information functionality existing, you are a lucky candidate to introduce some image &#8220;interrogation&#8221; (but not <a target=\"_blank\" title='?' href='http:\/\/www.youtube.com\/watch?v=vt0Y39eMvpI' rel=\"noopener\">this<\/a>) logic to your PHP code.<\/p>\n<p>We followed a lot of the advice of the very useful <a target=\"_blank\" title='PHP exif imagetype information' href='http:\/\/php.net\/manual\/en\/function.exif-imagetype.php' rel=\"noopener\">link<\/a> (thanks) to create some PHP called &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='exif_tester.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/exif_tester.php_GETME' rel=\"noopener\">exif_tester.php<\/a><\/li>\n<\/ul>\n<p> &#8230; where we may (or maybe not) be waking you up (<a target=\"_blank\" title='?' href='http:\/\/www.youtube.com\/watch?v=pIgZ7gMze7A' rel=\"noopener\">before we go go<\/a> <i>&#8216;Cause I&#8217;m not plannin&#8217; on going solo<\/i> yo (to be honest, like)) &#8230; it&#8217;s a slow news day &#8230; to the fact that images can show on a web page but may not be all you would understand them to be &#8230; shock, horror!<\/p>\n<p>Yes, an image that is a GIF in all but name will often display fine even if it&#8217;s been given a name like MyNameIs.Jpeg <strike>man<\/strike> person.<\/p>\n<p>If this <i><b>outrage<\/b><\/i> makes you &#8230;<\/p>\n<ul>\n<li>a) fall on the floor laughing<\/li>\n<li>b) cause a road rage incident<\/li>\n<li>c) wake up in a cold sweat<\/li>\n<li>d) wake up in a warmish to lukewarm sweat<\/li>\n<li>e) tear the cat&#8217;s hair out <font size=0>(no animals were harmed in the making of this blog posting)<\/font><\/li>\n<\/ul>\n<p> &#8230; then we&#8217;re here to tell you that you need to take a <a target=\"_blank\" title='Take a Bex ... and ...' href='https:\/\/www.youtube.com\/watch?v=BF6ffbz70SY' rel=\"noopener\">Bex<\/a> and have a lie down.<\/p>\n<p>In any case, there is a solution to this in PHP if the exif functionality is available to you, and this matter is of concern, and you can see us showing you how to test for that with the code above and this <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_tester.php\" title='Click picture' rel=\"noopener\">live run<\/a>.  Sometimes you&#8217;ll see <a target=\"_blank\" title='Gimp' href='http:\/\/gimp.org' rel=\"noopener\">Gimp<\/a> using exif functionality when it becomes aware of the possibility your image could be rotated to advantage &#8230; we&#8217;ve had this happen and thanked Gimp with more than the usual toast and herbal tea offerings you&#8217;d be used to giving &#8230; we take it?!<\/p>\n<p><b><i>Stop Press<\/i><\/b><\/p>\n<p>As of 8\/8\/2016 (<font size=1>well, what do you know? &#8230; understood everywhere!?<\/font>) we&#8217;re revisiting Exif and PHP to learn more and our <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_primer.jpg\" rel=\"noopener\">tutorial picture<\/a> now reflects the early days of the revisit and the new resultant PHP we wrote, that you could call <a target=\"_blank\" title='read_exif_off_image.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image.php_GETME' rel=\"noopener\">read_exif_off_image.php<\/a>, inspired, largely from <a target=\"_blank\" title=\"Useful\" href=\"http:\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data\" rel=\"noopener\">http:\/\/www.v-nessa.net\/2010\/08\/02\/using-php-to-extract-image-exif-data<\/a> (thanks), and has this <a target=\"_blank\" title='Live Run' href='http:\/\/www.rjmprogramming.com.au\/PHP\/read_exif_off_image.php?image=http:\/\/www.rjmprogramming.com.au\/Mindfulness\/clouds.jpg' rel=\"noopener\">live run<\/a> link, the output of which is pointed to by the red arrow in the <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/exif_primer.jpg\" rel=\"noopener\">tutorial picture<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15978' onclick='var dv=document.getElementById(\"d15978\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=gimp\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15978' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d23968' onclick='var dv=document.getElementById(\"d23968\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=rotation\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d23968' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d41544' onclick='var dv=document.getElementById(\"d41544\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d41544' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d41563' onclick='var dv=document.getElementById(\"d41563\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/google\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d41563' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d45597' onclick='var dv=document.getElementById(\"d45597\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/calc\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d45597' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d74940' onclick='var dv=document.getElementById(\"d74940\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/image\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d74940' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We have a new project on the go. We want to retain Exif information, that is contained within our iPhone&#8217;s *.HEIC formatted photographs, all the way through to some format and form of RJM Programming public website set of image &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-exif-retention-off-iphone-images-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,20,30,36,37],"tags":[2161,183,234,274,284,2039,360,406,2007,4808,590,4442,1658,626,631,662,3810,2178,778,929,931,1725,932,5716,5717,1129,1297,1319,1343,1411],"class_list":["post-74940","post","type-post","status-publish","format-standard","hentry","category-elearning","category-ios","category-photography","category-trips","category-tutorials","tag-airdrop","tag-camera","tag-command-line","tag-crontab","tag-curl","tag-digital-photography","tag-download","tag-exif","tag-filezilla","tag-heic","tag-image","tag-image-file","tag-imagemagick","tag-ios","tag-iphone","tag-jpeg","tag-macbook-air","tag-macos","tag-metadata","tag-photograph","tag-photography","tag-photos","tag-php","tag-retain","tag-retention","tag-sftp","tag-transfer","tag-tutorial","tag-upload","tag-web-server"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/74940"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=74940"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/74940\/revisions"}],"predecessor-version":[{"id":74947,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/74940\/revisions\/74947"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=74940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=74940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=74940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}