| View previous topic :: View next topic |
| Author |
Message |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Sun May 25, 2008 6:52 am Post subject: Trouble trying to create a link. |
|
|
Hey Humpa
Now that gps is becoming a part of our everyday lives, I'd like to build on my site and add a link under the images if the exif data contains gps data that can be clicked and a link opens up Google Maps to show where the pic was taken. Before I start attempting that, I've been trying it on some other php gallery software (purely because I don't want to break my mms pages). Part of the code says to use this:
| Code: |
function MakeMapURL($exif)
{
if (isset($exif['GPSVersion']))
{
echo “<a href=\"http://maps.google.com/maps?q=";
echo $exif['GPSLatitudeRef'];
echo $exif['GPSLatitude'];
echo ",+";
echo $exif['GPSLongitudeRef' ];
echo $exif['GPSLongitude'];
echo "&spn=0.0,0.0&t=h&hl=en\" target=\"_blank\">View location in Google Maps</a>“;
}
}
|
That was taken directly from the website I'm using to do this.
but when I then try and view my page, I get this error:
| Code: |
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/mysite/public_html/gps/exifgps/skins/rounded/templates/viewimage_exif.php on line 6
|
I'm obviously getting the coding slightly wrong, but I can't figure out where! Could you give me any pointers please?
Cheers  |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Sun May 25, 2008 10:06 am Post subject: |
|
|
That first quote isn't a normal double quote.
It is a “
It should be a " |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Mon May 26, 2008 7:04 pm Post subject: |
|
|
Cheers for that
You know how I never ask you for any help? Well, I'm getting closer to getting it all figured out now but I'm wondering if I could really push my luck and ask for just a couple of things???
1 .. You use a palm / ppc with gps iirc? If so, what s/w do you have loaded on it to tag your photos? I picked up an iPaq last week and am looking for something to do this with.
2 .. Do you have a picture - any picture - taken with your ppc (or any other hardware) that has gps exif data? If so, could you post it up for me please? I'd like to examine and compare the differences in the exif between my phone (Nokia N95) and other devices.
Really appreciate it! When this is all working, I'll post up the code for others to see/use/grab if they like.
Cheers! |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Mon May 26, 2008 8:34 pm Post subject: |
|
|
I've never taken a pic with any sort of gps tag or gps exif tag.
I used to use TomTom with my Axim PDA - but that didn't have a camera. My Nikon D300 can do it somehow - but you need a gps device that works with the D300. |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Tue May 27, 2008 6:36 pm Post subject: |
|
|
Hiya,
no worries about not having taken a pic with gps tag...I did a quick google "this jpg with gps exif data" and it came up with heaps for me to test
I've searched for a while to try and find something that will tag images I take with my iPaq but to no avail...But hell, I'm on night shift this week - and it's what Google was invented for!
I'm getting real close to achieving what I set out to do now, but I do have one bit I'm stuck with. I've trawled through your original code for ages trying to figure it out and I can't. I need to be able to add the main displayed image filename on my mms site to a part of my code...You know like if you go http://www.humpa.com/mms the main image is the Hummer bike that I posted? Well I'd like to take that main image and insert it into my code, something like this:
| Code: |
$arrPhotoExif = exif_read_data('the main image filename,'GPS');
|
Of course, whenever a different image is selected from the cells on the mms page, it would need to pick that one up instead.
Does that make sense to you? Looking through your code, I figure it's something to do with the $media_time$media_underscore$media_number$media_ext ?
Thanks for any help, I feel like I'm <--> this close now! |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed May 28, 2008 12:51 am Post subject: |
|
|
I guess you could stick it in the index.php file here:
| Code: |
}elseif(eregi("gif",$media_ext) OR eregi("jpg",$media_ext) OR eregi("png",$media_ext)) {
$middle_of_page .= "\n\t<br><br><a href=\"$path_to_media$media_time$media_underscore$media_number$media_ext\" target=\"_new\">\n";
$middle_of_page .= "\t<img src=\"phpThumb.php?src=$path_to_media$media_time$media_underscore$media_number$media_ext&w=$display_image_max_size_w&h=$display_image_max_size_h&q=95\" class=\"main_pic_frame\" alt=\"$media_time$media_ext\" title=\"click for full-sized pic! - $datestamp\"></a>\n";
} |
And you are correct about the path. $media_time$media_underscore$media_number$media_ext would be the local path, like media/200805281511.jpg |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed May 28, 2008 7:01 pm Post subject: |
|
|
that's a shame.
I spent a while this evening adding my code to yours and getting it just about right. Then I thought I ought to add an image that has GPS exif data so I can fully test it. I posted a new image but it didn't work correctly. When I saved the image from the site and examined it, the exif data had gone! I don't know if this is due to restrictions when the image is sent (my network I mean, not your code) or not. As you may remember, I have setup the ability to email rather than mms and when I checked an emailed image, that worked fine. Not really what I wanted to acheive as the idea was I could be out and about and post images that people could instantly see where I was.
The original file was 844kb and 2592 x 1944 but after posting it, it was only 41kb and 640 x 480. In my mms settings, I have the choice of image size - small/large or original and I use large.
Got any ideas - or do you think I'm right in saying it's my network? |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed May 28, 2008 7:20 pm Post subject: |
|
|
| Use "original". That should then be the "original" pic, right? |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed May 28, 2008 7:23 pm Post subject: |
|
|
I will try that just to check it works. Trouble is, I only got 1mb data free per month, which means I can send 1 pic fullsize and no browsing or my network will hammer me
I will try it out though and I'll post up the results. |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Thu May 29, 2008 11:12 pm Post subject: |
|
|
It came to me in a flash! Instead of sending a 800kb image, why not lower the settings within my camera? So I set my camera to take images of 640x480 which created a 100kb image. Sent that and it works perfectly
I'm about to post up in the MMS forum how to set it all up if others are interested.
Cheers for all the help Humpa  |
|
| Back to top |
|
 |
|