<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lucian Marica</title>
	<atom:link href="http://www.lucianmarica.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lucianmarica.com</link>
	<description>Yet another weblog</description>
	<lastBuildDate>Fri, 29 Apr 2011 09:58:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Short sunday ride</title>
		<link>http://www.lucianmarica.com/motorcycle/short-sunday-ride/</link>
		<comments>http://www.lucianmarica.com/motorcycle/short-sunday-ride/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 09:54:36 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Motorcycle]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=494</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0688_013/' title='DSC_0688_013'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0688_013-150x150.jpg" class="attachment-thumbnail" alt="DSC_0688_013" title="DSC_0688_013" /></a>
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0690_014/' title='DSC_0690_014'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0690_014-150x150.jpg" class="attachment-thumbnail" alt="DSC_0690_014" title="DSC_0690_014" /></a>
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0695_016/' title='DSC_0695_016'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0695_016-150x150.jpg" class="attachment-thumbnail" alt="DSC_0695_016" title="DSC_0695_016" /></a>
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0705_018/' title='DSC_0705_018'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0705_018-150x150.jpg" class="attachment-thumbnail" alt="DSC_0705_018" title="DSC_0705_018" /></a>
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0708_019/' title='DSC_0708_019'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0708_019-150x150.jpg" class="attachment-thumbnail" alt="DSC_0708_019" title="DSC_0708_019" /></a>
<a href='http://www.lucianmarica.com/motorcycle/short-sunday-ride/attachment/dsc_0714_021/' title='DSC_0714_021'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0714_021-150x150.jpg" class="attachment-thumbnail" alt="DSC_0714_021" title="DSC_0714_021" /></a>


]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/motorcycle/short-sunday-ride/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Night photoshoot</title>
		<link>http://www.lucianmarica.com/photo/night-photoshoot/</link>
		<comments>http://www.lucianmarica.com/photo/night-photoshoot/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 12:55:21 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Photo]]></category>
		<category><![CDATA[cluj napoca]]></category>
		<category><![CDATA[gps logger]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=475</guid>
		<description><![CDATA[Some test photos made with D90 under very low light conditions. The photos were geotagged using data collected with Hollux gps logger, and I must say, the locations are very, very accurate.]]></description>
			<content:encoded><![CDATA[<p>Some test photos made with D90 under very low light conditions. The photos were geotagged using data collected with Hollux gps logger, and I must say, the locations are very, very accurate.</p>

<a href='http://www.lucianmarica.com/photo/night-photoshoot/attachment/dsc_0009/' title='DSC_0009'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0009-150x150.jpg" class="attachment-thumbnail" alt="DSC_0009" title="DSC_0009" /></a>
<a href='http://www.lucianmarica.com/photo/night-photoshoot/attachment/dsc_0029/' title='DSC_0029'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0029-150x150.jpg" class="attachment-thumbnail" alt="DSC_0029" title="DSC_0029" /></a>
<a href='http://www.lucianmarica.com/photo/night-photoshoot/attachment/dsc_0031_01/' title='ISO 6400'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0031_01-150x150.jpg" class="attachment-thumbnail" alt="surprising good result at high iso" title="ISO 6400" /></a>
<a href='http://www.lucianmarica.com/photo/night-photoshoot/attachment/dsc_0046/' title='DSC_0046'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/DSC_0046-150x150.jpg" class="attachment-thumbnail" alt="DSC_0046" title="DSC_0046" /></a>
<a href='http://www.lucianmarica.com/photo/night-photoshoot/attachment/hdr-fusion/' title='hdr fusion'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2011/04/hdr-fusion-150x150.jpg" class="attachment-thumbnail" alt="hdr fusion" title="hdr fusion" /></a>
<br />

]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/photo/night-photoshoot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holux M-1200 test</title>
		<link>http://www.lucianmarica.com/motorcycle/holux-m-1200-test/</link>
		<comments>http://www.lucianmarica.com/motorcycle/holux-m-1200-test/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 17:27:10 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Motorcycle]]></category>
		<category><![CDATA[gps logger]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=450</guid>
		<description><![CDATA[Today I tested the Holux M-1200 gps logger. The device looks very robust, I didn`t read any info about water resistance, but if you plan to mount it somewhere under the windshield should be ok. It has an &#8220;on-off&#8221; button and a button for marking a POI. The three leds mark gps connectivity, battery status [...]]]></description>
			<content:encoded><![CDATA[<p>Today I tested the Holux M-1200 gps logger.<br />
The device looks very robust, I didn`t read any info about water resistance, but if you plan to mount it somewhere under the windshield should be ok. It has an &#8220;on-off&#8221; button and a button for marking a POI. The three leds mark gps connectivity, battery status and bluetooth connection. Regarding the functionality, is exactly what I wanted, it silently logs your position. A nice feature is that you can select the position to be logged either after specified number of seconds, or distance in meters, which is a very nice feature.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/motorcycle/holux-m-1200-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android gps logger</title>
		<link>http://www.lucianmarica.com/motorcycle/android-gps-logger/</link>
		<comments>http://www.lucianmarica.com/motorcycle/android-gps-logger/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 19:59:15 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Motorcycle]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[gps logger]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=431</guid>
		<description><![CDATA[If you are like me, and apart from the joy of the motorcycle ride you also like to savor the tours later on, checking the places and enjoying the photos, probably you have ran into the task of finding the perfect GPS solution for your needs. If not, trust me when I say is not [...]]]></description>
			<content:encoded><![CDATA[<p>If you are like me, and apart from the joy of the motorcycle ride you also like to savor the tours later on, checking the places and enjoying the photos, probably you have ran into the task of finding the perfect GPS solution for your needs. If not, trust me when I say is not easy. The solution that I am searching should help me get geottaged photos, have a full track of the ride, and gps system for getting me back on my way in need.</p>
<p>Many smartphones take geotagged photos, but even though now they have cameras that take pretty fine pictures, they can`t be compared with the photos of a DSLR camera. If you have your full ride tracked, you can geotag your pothos later on, using a program to match the time when photos was taken (from the exif data) with the location in your track. GPS systems for bikes are expensive, and I don`t consider them as a solution to log data for the whole tour. The better solution for me seems to be a small device that consumes little power and silently logs gps position.</p>
<p>For that today I downloaded two android apps and tested them on  a Samsung Galaxy S. Here are the recorded tracks from both of them.</p>
<p><a href="https://market.android.com/details?id=nl.sogeti.android.gpstracker">Open GPS Tracker</a></p>
<p><br />
<br/></p>
<p><a href="https://market.android.com/details?id=pl.com.digita.BikeComputer">Move! Bike Computer</a></p>
<p><br />
<br/></p>
<p>I put my phone in my outside chest pocket, using it in a inside pocked didn`t worked. The Move! Bike Computer recorded a more accurate track but maybe if I played a little more with the settings in Open Gps Tracker I could obtained a more detailed track there also. I think that both programs worked really well, and the results were satisfactory, but the problem is the phones batter life. For about 2 hours riding is consumed 45% of the battery.</p>
<p>Bottom line is that I don`t consider this to be a valid solution if you plan to make rides that would take many days. You need to keep the phone in an outside poket (pants upper pocket also didn`t worked), you will have to charge it alot, take care for the app not to be closed by mistake and so on, I think is to much hustle.</p>
<p>I have ordered the <a href="http://www.holux.com/JCore/en/products/products_content.jsp?pno=394">Holux M1200E</a> gps logger. It logs gps data and also can be used as a gps received to be paired with a laptop via bluetooth. More on that when I`ll get a hold on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/motorcycle/android-gps-logger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Around Cluj Napoca</title>
		<link>http://www.lucianmarica.com/motorcycle/around-cluj-napoca/</link>
		<comments>http://www.lucianmarica.com/motorcycle/around-cluj-napoca/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 08:17:02 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Motorcycle]]></category>
		<category><![CDATA[cluj napoca]]></category>
		<category><![CDATA[gps logger]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=417</guid>
		<description><![CDATA[Yesterday I had a terrible terrible day at work. A lot of work to get done so I needed to stay till  evening. So I decided to get on the bike and take it for a ride. Nothing fancy, nothing spectacular, just a short spin to release some stress while searching mostly for tarmac free [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I had a terrible terrible day at work. A lot of work to get done so I needed to stay till  evening. So I decided to get on the bike and take it for a ride. Nothing fancy, nothing spectacular, just a short spin to release some stress while searching mostly for tarmac free roads.</p>

<a href='http://www.lucianmarica.com/motorcycle/around-cluj-napoca/attachment/img_0613/' title='IMG_0613'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/07/IMG_0613-150x150.jpg" class="attachment-thumbnail" alt="IMG_0613" title="IMG_0613" /></a>
<a href='http://www.lucianmarica.com/motorcycle/around-cluj-napoca/attachment/img_0610/' title='IMG_0610'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/07/IMG_0610-150x150.jpg" class="attachment-thumbnail" alt="IMG_0610" title="IMG_0610" /></a>
<a href='http://www.lucianmarica.com/motorcycle/around-cluj-napoca/attachment/img_0611/' title='IMG_0611'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/07/IMG_0611-150x150.jpg" class="attachment-thumbnail" alt="IMG_0611" title="IMG_0611" /></a>
<br />

]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/motorcycle/around-cluj-napoca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cluj Napoca</title>
		<link>http://www.lucianmarica.com/stuff/cluj-napoca/</link>
		<comments>http://www.lucianmarica.com/stuff/cluj-napoca/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 11:11:44 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[cluj napoca]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=384</guid>
		<description><![CDATA[Today while I was out I had taken these two shoots. The quality is poor, pictures were taken with phone at twilight, and have some amount of granulation. But I like this place, I would love to see as more places like this as possible in this city. Also, a nice picture with transalp :D]]></description>
			<content:encoded><![CDATA[<p>Today while I was out I had taken these two shoots. The quality is poor, pictures were taken with phone at twilight, and have some amount of granulation. But I like this place, I would love to see as more places like this as possible in this city. Also, a nice picture with transalp :D</p>
<div id="attachment_385" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-07.06.2010-11-44-06.jpg" rel="lightbox[384]"><img class="size-thumbnail wp-image-385" title="Cluj Napoca" src="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-07.06.2010-11-44-06-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Cluj Napoca</p></div>
<div id="attachment_386" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-07.06.2010-11-44-19.jpg" rel="lightbox[384]"><img class="size-thumbnail wp-image-386" title="Cluj Napoca" src="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-07.06.2010-11-44-19-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Cluj Napoca</p></div>
<div id="attachment_411" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-09.07.2010-08-01-46.jpg" rel="lightbox[384]"><img class="size-thumbnail wp-image-411" title="In the fields" src="http://www.lucianmarica.com/wp-content/uploads/2010/06/Mobile-Photo-09.07.2010-08-01-46-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">In the fields</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/stuff/cluj-napoca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1st of May &#8211; Valea Ierii</title>
		<link>http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/</link>
		<comments>http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/#comments</comments>
		<pubDate>Sat, 01 May 2010 18:47:08 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Motorcycle]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=369</guid>
		<description><![CDATA[The long break I took from riding my motorcycle finally came to an end today. I made a small trip with some friends (they were with cars), to a beautiful location not far from Cluj. I must say it was truly delightful and made me dream again of journeys with no worries and no destinations.]]></description>
			<content:encoded><![CDATA[<p>The long break I took from riding my motorcycle finally came to an end today. I made a small trip with some friends (they were with cars), to a beautiful location not far from Cluj. I must say it was truly delightful and made me dream again of journeys with no worries and no destinations.<br />

<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/216/' title='216'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/216-150x150.jpg" class="attachment-thumbnail" alt="216" title="216" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/217/' title='217'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/217-150x150.jpg" class="attachment-thumbnail" alt="217" title="217" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/218/' title='218'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/218-150x150.jpg" class="attachment-thumbnail" alt="218" title="218" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/219/' title='219'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/219-150x150.jpg" class="attachment-thumbnail" alt="219" title="219" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/220/' title='220'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/220-150x150.jpg" class="attachment-thumbnail" alt="220" title="220" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/221/' title='221'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/221-150x150.jpg" class="attachment-thumbnail" alt="221" title="221" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/223/' title='223'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/223-150x150.jpg" class="attachment-thumbnail" alt="223" title="223" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/224/' title='224'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/224-150x150.jpg" class="attachment-thumbnail" alt="224" title="224" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/225/' title='225'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/225-150x150.jpg" class="attachment-thumbnail" alt="225" title="225" /></a>
<a href='http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/attachment/226/' title='226'><img width="150" height="150" src="http://www.lucianmarica.com/wp-content/uploads/2010/05/226-150x150.jpg" class="attachment-thumbnail" alt="226" title="226" /></a>
</p>

]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/motorcycle/1-may-valea-ierii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geotagging from image EXIF data in WordPress</title>
		<link>http://www.lucianmarica.com/stuff/geotagging-from-image-exif-data-in-wordpress/</link>
		<comments>http://www.lucianmarica.com/stuff/geotagging-from-image-exif-data-in-wordpress/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 03:30:47 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[exif]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/stuff/teat/</guid>
		<description><![CDATA[Displaying imagine location in wordpress using their gps coords proved to be not as easy as I initially thought, but it is something I wanted to get done from some time now, so I decided to get down on it. I have chosen to use geotag plugin for its capability to read exif data from [...]]]></description>
			<content:encoded><![CDATA[<p>Displaying imagine location in wordpress using their gps coords proved to be not as easy as I initially thought, but it is something I wanted to get done from some time now, so I decided to get down on it. I have chosen to use <a href="http://wordpress.org/extend/plugins/geotag/" target="_blank">geotag</a> plugin for its capability to read exif data from images spread through a post and nicely locate them on a google map, among other stuff.</p>
<p>Unfortunately, after uploading few images I discovered that the cool functionality of searching photos with gps exif data and displaying their location on map was not working. That was because the images displayed don`t have any exif data stored in the file, as wordpress automatically  stripes it down on image upload, but not before data is read so it can be stored serialized in postmeta table from db. Instead of altering wordpress core files to modify this behavior, I preferred to find a different approach and try using the meta info already stored into database. But the problem is that wp save only some tags from exif, and GPS information in not among them, so first step is to add the following filter to the wp_read_image_metadata hook:</p>
<pre class="brush: php; title: ;">add_filter('wp_read_image_metadata', 'saveGeoExif','',3);

function saveGeoExif($meta,$file) {
    $exif = @exif_read_data($file);

    if (isset($exif['GPSLatitude'])){
        $meta['GPSLatitude'] = $exif['GPSLatitude'];
    }
    if (isset($exif['GPSLatitudeRef'])){
        $meta['GPSLatitudeRef'] = trim($exif['GPSLatitudeRef']);
    }
    if (isset($exif['GPSLongitude'])){
        $meta['GPSLongitude'] = $exif['GPSLongitude'] ;
    }
    if (isset($exif['GPSLongitudeRef'])){
        $meta['GPSLongitudeRef'] = trim($exif['GPSLongitudeRef']);
    }

    if (isset($exif['GPSAltitudeRef'])){
        $meta['GPSAltitudeRef'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSAltitude'])){
        $meta['GPSAltitude'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSTimeStamp'])){
        $meta['GPSTimeStamp'] = $exif['GPSLongitudeRef'];
    }
    if (isset($exif['GPSDOP'])){
        $meta['GPSDOP'] = $exif['GPSLongitudeRef'];
    }
    if (isset($exif['GPSImgDirectionRef'])){
        $meta['GPSImgDirectionRef'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSImgDirection'])){
        $meta['GPSImgDirection'] = trim($exif['GPSLongitudeRef']);
    }

	return $meta;
}
</pre>
<p>This will save all GPS information into database upon image upload.</p>
<p>Next we need to search all the photo attachments belonging to a post, calculate their coordinates and extract image url, and then pass them to geotag plugin.</p>
<pre class="brush: php; title: ;">add_filter(&quot;the_content&quot;, 'getGeodataFromMeta');

function fractionResult($fraction){
    list($sup, $sub) = explode('/', $fraction);
    if(floatval($sub) != 0){
        return $sup / $sub;
    }else{
        return 0;
    }
}

function getCoord($fractional, $ref){
    $coord = 0;
    if(is_array($fractional)){
        $coord = fractionResult($fractional[0]) + fractionResult($fractional[1]) / 60 + fractionResult($fractional[2]) / 3600;
    }
    if($ref == &quot;S&quot; || $ref == &quot;W&quot;){
        $coord = -$coord;
    }
    return $coord;
}

function getGeodataFromMeta($content){
    global $photoMetaCoords;
    $postId = get_the_ID();
    $attachments = get_posts('post_type=attachment&amp;post_mime_type=image&amp;post_parent=' . $postId);

    foreach ($attachments as $attachment){
        $meta = wp_get_attachment_metadata($attachment-&gt;ID);
        if(isset($meta['image_meta']['GPSLatitude'])){
            $lat = getCoord($meta['image_meta']['GPSLatitude'], $meta['image_meta']['GPSLatitudeRef']);
            $long = getCoord($meta['image_meta']['GPSLongitude'], $meta['image_meta']['GPSLongitudeRef']);

            $imageUrl = wp_get_attachment_image_src($attachment-&gt;ID, array(133, 133));
            $photo = array(
                'lat' =&gt; $lat,
                'lon' =&gt; $long,
                'uri' =&gt; $imageUrl[0]
            );

            $photoMetaCoords[] = $photo;
        }
    }
    return $content;
}</pre>
<p>Last thing we need to do in order to get all this to work is to alter a bit geotag plugin, so it will also load the images from $photoMetaCoords array. In function getGeotagsFromPhotos() add the following line before <em>if (empty($geotags)) {return null;} el</em>se&#8230; :</p>
<pre class="brush: php; title: ;">$geotags = array_merge($geotags, $photoMetaCoords);
$photoMetaCoords = array();
</pre>
<p>Also at the begining of getGeotagsFromPhotos() function change:</p>
<pre class="brush: php; title: ;">global $post;</pre>
<p>to</p>
<pre class="brush: php; title: ;">global $post, $photoMetaCoords;</pre>
<p>That`s it!</p>
<p>All the code presented here should be added in functions.php or in geotag.php (except the last line which should always go in geotag.php, of course :) ).</p>
<div id="attachment_337" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-158.jpg" rel="lightbox[272]"><img class="size-thumbnail wp-image-337" title="test 158" src="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-158-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">turda</p></div>
<div id="attachment_334" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-194.jpg" rel="lightbox[272]"><img class="size-thumbnail wp-image-334" title="test 194" src="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-194-150x150.jpg" alt="flowers" width="150" height="150" /></a><p class="wp-caption-text">flowers</p></div>
<div id="attachment_343" class="wp-caption alignleft" style="width: 160px"><a href="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-195.jpg" rel="lightbox[272]"><img class="size-thumbnail wp-image-343" title="test 195" src="http://www.lucianmarica.com/wp-content/uploads/2010/04/test-195-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">pfff</p></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/stuff/geotagging-from-image-exif-data-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Javascript VIN (car chassis) number validation</title>
		<link>http://www.lucianmarica.com/php/javascript-vin-car-chassis-number-validation/</link>
		<comments>http://www.lucianmarica.com/php/javascript-vin-car-chassis-number-validation/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 10:09:18 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[javascript validation]]></category>
		<category><![CDATA[vin]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=197</guid>
		<description><![CDATA[Well this isn`t php, is a JavaScript code that validates a car chassis number (VIN). I expect comments on improving the code, as JavaScript isn`t my strong point, I know just as much as any php web developer should know. var vinletters=new Array(); vinletters[1]=&#34;AJ&#34;; vinletters[2]=&#34;BKS&#34;; vinletters[3]=&#34;CLT&#34;; vinletters[4]=&#34;DMU&#34;; vinletters[5]=&#34;ENV&#34;; vinletters[6]=&#34;FW&#34;; vinletters[7]=&#34;GPX&#34;; vinletters[8]=&#34;HY&#34;; vinletters[9]=&#34;RZ&#34;; //--------------12345678901234567 var vinweight= [...]]]></description>
			<content:encoded><![CDATA[<p>Well this isn`t php, is a JavaScript code that validates a car chassis number (VIN). I expect comments on improving the code, as JavaScript isn`t my strong point, I know just as much as any php web developer should know.</p>
<pre class="brush: jscript; title: ;">
var vinletters=new Array();
vinletters[1]=&quot;AJ&quot;;
vinletters[2]=&quot;BKS&quot;;
vinletters[3]=&quot;CLT&quot;;
vinletters[4]=&quot;DMU&quot;;
vinletters[5]=&quot;ENV&quot;;
vinletters[6]=&quot;FW&quot;;
vinletters[7]=&quot;GPX&quot;;
vinletters[8]=&quot;HY&quot;;
vinletters[9]=&quot;RZ&quot;;

//--------------12345678901234567
var vinweight= &quot;8765432T098765432&quot;;

function valvin(serie){
	if(serie.length == 17){
		suma = 0;
		for (i=0 ; i &lt; serie.length; i++) {
			nextchar = serie.charAt(i);
			for (j in vinletters){
				if(vinletters[j].indexOf(nextchar) != -1){
					nextchar = j;
				}
			}
			val = parseInt(nextchar);
			weight = vinweight.charAt(i);
			if(weight == &quot;T&quot;){
				weight = 10;
			}else{
				weight = parseInt(weight);
			}
			suma += val * weight;
		}
		controlchar = suma % 11;
		if(controlchar == 10) controlchar = &quot;X&quot;;
		if(controlchar == serie.charAt(8)){
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
	return false;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/php/javascript-vin-car-chassis-number-validation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Truly inspirational</title>
		<link>http://www.lucianmarica.com/stuff/truly-inspirational/</link>
		<comments>http://www.lucianmarica.com/stuff/truly-inspirational/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 05:47:23 +0000</pubDate>
		<dc:creator>Lucian Marica</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.lucianmarica.com/?p=63</guid>
		<description><![CDATA[Well I`m sure that most of you saw this video and heard about Matt.  A regular 32-year-old guy who suddenly realized that life can offer a lot more than what he was asking for. This is his first video, who made him very popular over YouTube. I can`t describe the feelings I have when I [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Well I`m sure that most of you saw this video and heard about <a href="http://www.wherethehellismatt.com/about.shtml" target="_blank">Matt</a>.  A regular 32-year-old guy who suddenly realized that life can offer a lot more than what he was asking for. This is his first video, who made him very popular over YouTube. I can`t describe the feelings I have when I see thees movies&#8230; amazing.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/bNF_P281Uu4&amp;hl=en&amp;fs=1&amp;rel=0&amp;autoplay=0" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent"><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/bNF_P281Uu4&amp;hl=en&amp;fs=1&amp;rel=0&amp;autoplay=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: left;">In 2008 he released a second one.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/zlfKdbWwruY&amp;hl=en&amp;fs=1&amp;rel=0&amp;hd=0&amp;autoplay=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/zlfKdbWwruY&amp;hl=en&amp;fs=1&amp;rel=0&amp;hd=0&amp;autoplay=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: left;">It really makes me shiver.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lucianmarica.com/stuff/truly-inspirational/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

