<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: EXIF Parser</title>
	<atom:link href="http://notions.okuda.ca/mg2-hacks/exif-parser/feed/" rel="self" type="application/rss+xml" />
	<link>http://notions.okuda.ca</link>
	<description>A mental image or representation; an idea or conception</description>
	<lastBuildDate>Sat, 04 Feb 2012 00:52:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Anders Borg</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-102415</link>
		<dc:creator>Anders Borg</dc:creator>
		<pubDate>Fri, 10 Jul 2009 23:03:31 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-102415</guid>
		<description>Sorry. Forgot to remove the line breaks from previous use of print and . This is the way it should be:

$latitude = decimalcoord($exif[&#039;GPSLatitude&#039;]);
$longitude = decimalcoord($exif[&#039;GPSLongitude&#039;]);
// Adjust also above values to the &quot;Ref&quot; settings

function decimalcoord($values)
{
    return divide($values[0]) + divide($values[1]) / 60 + divide($values[2]) / 3600;
}

function divide($value)
{
    $values = explode(&quot;/&quot;, $value);
    return $values[0] / $values[1];
}</description>
		<content:encoded><![CDATA[<p>Sorry. Forgot to remove the line breaks from previous use of print and . This is the way it should be:</p>
<p>$latitude = decimalcoord($exif['GPSLatitude']);<br />
$longitude = decimalcoord($exif['GPSLongitude']);<br />
// Adjust also above values to the &#8220;Ref&#8221; settings</p>
<p>function decimalcoord($values)<br />
{<br />
    return divide($values[0]) + divide($values[1]) / 60 + divide($values[2]) / 3600;<br />
}</p>
<p>function divide($value)<br />
{<br />
    $values = explode(&#8220;/&#8221;, $value);<br />
    return $values[0] / $values[1];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders Borg</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-102414</link>
		<dc:creator>Anders Borg</dc:creator>
		<pubDate>Fri, 10 Jul 2009 23:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-102414</guid>
		<description>Here&#039;s a more elegant solution (IMO) to calculating correct decimal coordinates:

$latitude = decimalcoord($exif[&#039;GPSLatitude&#039;]) . &quot;\r\n&quot;;
$longitude = decimalcoord($exif[&#039;GPSLongitude&#039;]) . &quot;\r\n&quot;;
// Adjust also above values to the &quot;Ref&quot; settings

function decimalcoord($values)
{
    return divide($values[0]) + divide($values[1]) / 60 + divide($values[2]) / 3600;
}

function divide($value)
{
    $values = explode(&quot;/&quot;, $value);
    return $values[0] / $values[1];
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a more elegant solution (IMO) to calculating correct decimal coordinates:</p>
<p>$latitude = decimalcoord($exif['GPSLatitude']) . &#8220;\r\n&#8221;;<br />
$longitude = decimalcoord($exif['GPSLongitude']) . &#8220;\r\n&#8221;;<br />
// Adjust also above values to the &#8220;Ref&#8221; settings</p>
<p>function decimalcoord($values)<br />
{<br />
    return divide($values[0]) + divide($values[1]) / 60 + divide($values[2]) / 3600;<br />
}</p>
<p>function divide($value)<br />
{<br />
    $values = explode(&#8220;/&#8221;, $value);<br />
    return $values[0] / $values[1];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-92057</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Thu, 15 Jan 2009 22:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-92057</guid>
		<description>It looks like you&#039;re ignoring the scaling factor (denominator) that is present in the GPSLatitude and GPSLongitude fields. The usual case seems to be that these will be 1 except for the minutes of angle, which is usually 100. Updated code to handle this usual case:

return $deg + ( $min / 6000 ) + ( $sec / 3600 );

It&#039;s important to note that this is still not entirely correct according to the Exif v 2.2 specifications, see pages 53 (GPSLatitude and GPSLongitude) and page 20 (rational data type):

http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf

A more correct solution would be modifying ConvertFractionToDecimal as follows:

function ConvertFractionToDecimal ( $fraction )
{
    if ( !isset ( $fraction ) )
        return 0;

    $dividerPosition = strpos ( $fraction, &#039;/&#039; );

    if ( $dividerPosition === false )
        return $fraction;

    return substr ( $fraction, 0, $dividerPosition ) / substr ( $fraction, $dividerPosition + 1 );
}

This would allow any scaling factor/denominator to be used, as per Exif specs.</description>
		<content:encoded><![CDATA[<p>It looks like you&#8217;re ignoring the scaling factor (denominator) that is present in the GPSLatitude and GPSLongitude fields. The usual case seems to be that these will be 1 except for the minutes of angle, which is usually 100. Updated code to handle this usual case:</p>
<p>return $deg + ( $min / 6000 ) + ( $sec / 3600 );</p>
<p>It&#8217;s important to note that this is still not entirely correct according to the Exif v 2.2 specifications, see pages 53 (GPSLatitude and GPSLongitude) and page 20 (rational data type):</p>
<p><a href="http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf" rel="nofollow">http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf</a></p>
<p>A more correct solution would be modifying ConvertFractionToDecimal as follows:</p>
<p>function ConvertFractionToDecimal ( $fraction )<br />
{<br />
    if ( !isset ( $fraction ) )<br />
        return 0;</p>
<p>    $dividerPosition = strpos ( $fraction, &#8216;/&#8217; );</p>
<p>    if ( $dividerPosition === false )<br />
        return $fraction;</p>
<p>    return substr ( $fraction, 0, $dividerPosition ) / substr ( $fraction, $dividerPosition + 1 );<br />
}</p>
<p>This would allow any scaling factor/denominator to be used, as per Exif specs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evert</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-51801</link>
		<dc:creator>Evert</dc:creator>
		<pubDate>Tue, 27 Nov 2007 21:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-51801</guid>
		<description>thanks that was helpful.. 

btw.. the ExifConvertDegMinSecToDD can be simplified..  simply change it to:

return $deg + ($min / 60) + ($sec / 3600);</description>
		<content:encoded><![CDATA[<p>thanks that was helpful.. </p>
<p>btw.. the ExifConvertDegMinSecToDD can be simplified..  simply change it to:</p>
<p>return $deg + ($min / 60) + ($sec / 3600);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Poco</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-26</link>
		<dc:creator>Poco</dc:creator>
		<pubDate>Thu, 06 Apr 2006 08:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-26</guid>
		<description>Hmmm, I like it, I&#039;m still new to PHP and learning as I go.  I will file that one away.  Thanks for the feedback.</description>
		<content:encoded><![CDATA[<p>Hmmm, I like it, I&#8217;m still new to PHP and learning as I go.  I will file that one away.  Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://notions.okuda.ca/mg2-hacks/exif-parser/comment-page-1/#comment-25</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Thu, 06 Apr 2006 01:12:21 +0000</pubDate>
		<guid isPermaLink="false">http://notions.okuda.ca/mg2-hacks/exif-parser/#comment-25</guid>
		<description>Howdy,  

   Thanks the code for the Cannon ISO was very helpful,  I did it a little differently though.   : )

$ISORatings = array(15=&gt;&#039;Auto&#039;, 16=&gt;&#039;50&#039;, 17=&gt;&#039;100&#039;, 18=&gt;&#039;200&#039;, 19=&gt;&#039;400&#039;);

if (isset($varRawEXIF[&#039;ISOSpeedRating&#039;])){
   $newEXIFData[&#039;ISO Speed&#039;] = $varRawEXIF[&#039;EXIF&#039;][&#039;ISOSpeedRatings&#039;];
}else if(isset($varRawEXIF[&#039;MAKERNOTE&#039;][&#039;ModeArray&#039;][16])){
   $newEXIFData[&#039;ISO Speed&#039;] = $ISORatings[$varRawEXIF[&#039;MAKERNOTE&#039;][&#039;ModeArray&#039;][16]];
}</description>
		<content:encoded><![CDATA[<p>Howdy,  </p>
<p>   Thanks the code for the Cannon ISO was very helpful,  I did it a little differently though.   : )</p>
<p>$ISORatings = array(15=&gt;&#8217;Auto&#8217;, 16=&gt;&#8217;50&#8242;, 17=&gt;&#8217;100&#8242;, 18=&gt;&#8217;200&#8242;, 19=&gt;&#8217;400&#8242;);</p>
<p>if (isset($varRawEXIF['ISOSpeedRating'])){<br />
   $newEXIFData['ISO Speed'] = $varRawEXIF['EXIF']['ISOSpeedRatings'];<br />
}else if(isset($varRawEXIF['MAKERNOTE']['ModeArray'][16])){<br />
   $newEXIFData['ISO Speed'] = $ISORatings[$varRawEXIF['MAKERNOTE']['ModeArray'][16]];<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

