Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 ... 5 6 7 8 [9] 10 11 12 13 ... 15   Go Down

Author Topic: Google Map in Coppermine Gallery, version 2 (of mod and api)  (Read 326025 times)

0 Members and 1 Guest are viewing this topic.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #160 on: July 28, 2007, 07:42:38 pm »

It shouldn't be a problem because my database doesn't use cpg_ either. I think the script does a replace on the characters since it knows what prefix you use. So no, you shouldn't edit the prefix in the update.sql file. I don't know what could cause this to fail. Have you done previous updates with Coppermine core files before? Did the database changes "take"?

The only things I can think of was that update.sql wasn't successfully uploaded to the server or update.php wasn't run.
Logged

jamesjoyce

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • D-Eye
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #161 on: July 28, 2007, 10:34:31 pm »

I just upgraded to the latest version op Coppermine, ran update.php and verified. Everythin ok. I started again with your modifications and when I run update.php after modifying sql/update.sql I verified via PhpMyAdmin the CPG_config table. No gmap_... to see  ??? I keep looking what can be the problem...
Logged

jamesjoyce

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • D-Eye
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #162 on: July 29, 2007, 01:20:08 pm »

OK. I manually executed the sql queries and did all the modifications. Now, I just have to figure out how to work with it  :-[
Logged

jamesjoyce

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • D-Eye
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #163 on: July 31, 2007, 03:23:26 pm »

So happy as a child  :D

Still a lot work to do but here are the first results.

One additional problem is that I'll have to convert all my co÷rdinates. Please, make this auto exif reading work  ::)

http://d-eye.be/portfolio/thumbnails.php?album=49

http://www.d-eye.be/portfolio/googlemaps.php
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #164 on: July 31, 2007, 04:49:06 pm »

One additional problem is that I'll have to convert all my co÷rdinates. Please, make this auto exif reading work  ::)
My camera doesn't do GPS so I can't test things out. Does Coppermine's exif code handle GPS? That's the only way I could think of that this mod could do auto exif because I don't know how to work with it myself.

Please don't roll your eyes at me.
Logged

jamesjoyce

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • D-Eye
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #165 on: July 31, 2007, 04:58:52 pm »

Sorry or the eyes...

Probably coppermine doesn't support the gps tags in exif yet. I found this discussion:

http://forum.coppermine-gallery.net/index.php?topic=37439.0

I was misled by a previous post in this tread by someone who wrote a little script...

Thanks again!
Logged

pocketmon

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #166 on: August 07, 2007, 03:45:36 pm »

Sorry or the eyes...

Probably coppermine doesn't support the gps tags in exif yet. I found this discussion:

http://forum.coppermine-gallery.net/index.php?topic=37439.0

I was misled by a previous post in this tread by someone who wrote a little script...

Thanks again!

I did make it. Just call the function to get location information in EXIF and pass them to addpic.
Please check.
http://forum.coppermine-gallery.net/index.php?topic=31206.80
Logged

pocketmon

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #167 on: August 07, 2007, 04:36:12 pm »

I did make it. Just call the function to get location information in EXIF and pass them to addpic.
Please check.
http://forum.coppermine-gallery.net/index.php?topic=31206.80

One other fix to GPS information parsing is find in include\makers\gps.php

Code: [Select]
                     $data = $hour+$minutes/60+$seconds/3600;

replace with
Code: [Select]
if ( $intel == 1)
{
                                $data = $hour+$minutes/60+$seconds/3600;
                        }
else
{
$data = $seconds+$minutes/60+$hour/3600;
}
       
Logged

pocketmon

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #168 on: August 10, 2007, 05:10:12 pm »

Here is step by step procedure to make this mod. to support getting GPS information in EXIF.

The procedure here is baed on 1.4.10. I am not sure if it is compatible to later version.

1.Modify GPS EXIF decoding, to support different endian
in  include\makers\gps.php
find code, near line 237
Code: [Select]
$data = $hour+$minutes/60+$seconds/3600;
change it to
Code: [Select]
if ( $intel == 1)
{
    $data = $hour+$minutes/60+$seconds/3600;
}
else
{
    $data = $seconds+$minutes/60+$hour/3600;
}

2.Modify to extract GPS information of EXIF when adding new pictures.
in include/picmgmt.inc.php
find code, near line 24
Code: [Select]
if($CONFIG['read_iptc_data'] ){
        include("include/iptc.inc.php");
}
ADD following code after
Code: [Select]
include("include/exif.php");

find code, near line 34
Code: [Select]
    $image = $CONFIG['fullpath'] . $filepath . $filename;
    $normal = $CONFIG['fullpath'] . $filepath . $CONFIG['normal_pfx'] . $filename;
    $thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $filename;
ADD following code after
Code: [Select]
    $Latitude='';
    $Longitude='';

Find, 4 lines after previous code
Code: [Select]
    if (!is_known_filetype($image)) {
        return false;
    } elseif (is_image($filename)) {
        $imagesize = getimagesize($image);


ADD following after
Code: [Select]
        $exifRawData=read_exif_data_raw($image,0);
        if(is_array($exifRawData['GPS']))
        {
        $Longitude=$exifRawData['GPS']['Longitude'];
        if(strncmp($exifRawData['GPS']['Longitude Reference'],"W",1)==0)
        {
        $Longitude = '-'.$Longitude;
        }
        $Latitude=$exifRawData['GPS']['Latitude'];
        if(strncmp($exifRawData['GPS']['Latitude Reference'],"S",1)==0)
        {
        $Latitude = '-'.$Latitude;
        }
       
        }

Find, near line 130 ( the line count is that before modification)

Code: [Select]
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";


MODIFY to
Code: [Select]
    if($Latitude == '')
    {
    // modified end
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
    //movidifed
    }
    else
    {
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position, latitude, longitude) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}', '{$Latitude}', '{$Longitude}')";
    }


3. Finish. Try it. Just add your JPEG files embedded with GPS information in any way Coppermine supports.

------------------------------------------------------------------------------------------------
Regarding the way to add GPS information into JPEG, you can try
1. Picasa ( no GPS needed)
2. gpsphoto.pl ( support RAW file)
3. gpsphotoLink (for Mac only)
4. Robogeo

I only have experience with Robogeo, which does great job, except that it didn't support Canon's CRW/CR2 file.
Logged

cpgfan67

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #169 on: August 10, 2007, 10:52:41 pm »

Hi Tranz,

Marvellous work with regards to your gmap mod, works like an absolute dream :) I followed your instructions and based them on gallery version 1.4.10.  Now in the wake of the recent gallery release (1.4.12) I'd quite like to upgrade. 

I'm assuming that applying the upgrade will overwrite the gmap mod changes made to some of the files with the updated copies of the same files from the 1.4.12 download.  I've kept copies of the 1.4.10 modified files to one side and wondered if it would cause a problem simply uploading these to the appropriate places in the site after uploading the coppermine 1.4.12 files or alternatively not overwriting the modified gmap files?  I've got a mysql dump and site backup to roll back to. 

Apologies if this has already been answered somewhere else.  I had a quick look round and didn't see anthing especially relevant to my question so I thought I'd post here. 

Many thanks!
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #170 on: August 10, 2007, 11:28:10 pm »

Thanks, I'm glad you like the mod.

Upgrades are the bane of modders everywhere, but they're necessary. :(

What I do to handle updates is to use WinMerge to diff the code.

- First I backup my current directory
- Then I compare the current gallery to the new version and move code over
- If I'm not sure if a code change is core or mod, I will compare the backup of the current with the version that matches the version that is being replaced, in your case, 1.4.10
- It helps to learn the keyboard shortcuts to do this quickly since there are a lot of files to process
- It is a tedious activity so reserve it for a time when you don't mind doing it

Hope that helps.
Logged

cpgfan67

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #171 on: August 11, 2007, 06:24:21 pm »

Cheers for your prompt reply Tranz :)

As you say, I guess it's gonna take time to work out whether the changes that have been made in 1.4.12 will work with your modifications but then, hey, its taken a whole lot of time to get this far with coppermine so I guess a little more work won't make much difference;)
I'll give the program you suggested a look.  Within the context you mention it in, it certainly looks quite useful.  I'll give it a go and see what happens, I hope the next release isn't to close ;) Cheers!  
Logged

cpgfan67

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #172 on: August 12, 2007, 10:32:07 pm »

Just thought I'd post an update on my last post. 

The program you suggested (Winmerge) was really useful and helped highlight the changes between my current modified coppermine files and the new 1.4.12 release.  Moving code over from the modified 1.4.10 files was a doddle and I managed not to overwrite anything important to the 1.4.12 release. All seems to work well as far as I can see. :)
Logged

snark

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Coppermine gallery
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #173 on: August 15, 2007, 10:58:48 pm »

Hi,

I've not followed up the changes to this mod, so sorry for asking the question: is it possible to select a default view for the map, when assigning a position to the pictures?

Example: in my Venice gallery, I'd like the map to be zoomed on Venice only, while on my London gallery, it should be zoomed by default on London. I guess it should use some setting per album.

Thanks!
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #174 on: August 16, 2007, 02:24:22 am »

Could you please clarify what you mean by gallery? Do you mean albums or separate gallery installations?

The map config allows you to set your default center for each installation.
Logged

snark

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Coppermine gallery
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #175 on: August 16, 2007, 08:07:19 am »

Could you please clarify what you mean by gallery? Do you mean albums or separate gallery installations?
Yes, sorry, I meant individual albums.

The map config allows you to set your default center for each installation.
Yes, I found this. But I'd like a default center per album.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #176 on: August 16, 2007, 05:10:14 pm »

If thumbnails.php has this:
Code: [Select]
$center_avg_coords = TRUE;
then you should see the view based on the location of the photos in that album. Are you seeing otherwise? Please post urls.

I think having manual settings per albums would complicate things.
Logged

snark

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Coppermine gallery
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #177 on: August 16, 2007, 11:31:56 pm »

Are you seeing otherwise? Please post urls.

I lost the function since I installed the last CPG update, as I didn't save a backup of the modified files :'( .
I'll reimplement the changes in the coming days, test and let you know.
Logged

carlo1

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #178 on: September 12, 2007, 10:49:02 pm »

autsch :-( something is wrong after installing this mod. i hope someone can help me.
please look at my side and you will see the big big mistake.
http://hoelzlmani.pytalhost.de/cpg141/

at the beginning you will find a lot of text, after this, i can see the gallery. i don┤t know what is wrong.
i changed this files:
map.inc.php
german.php
langfallback.inc.php
admin.php
editOnePic.php
editpics.php

also i registered for the api key.
i have one new file called googlemap.php. this is the file i created in replay #2. what i must do with this file?
also i changed the database.

i installed only version 2, i can┤t find v1? is this my problem? i can┤t find how to install v1.

thank you very much.
Logged

carlo1

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Google Map in Coppermine Gallery, version 2 (of mod and api)
« Reply #179 on: September 14, 2007, 08:16:24 pm »

i reinstall all, but now i have new problems :-(
i changed all files again i wrote before, but i can┤t see any changes in my configurations menu, so it is not possible to change the api key.
after klick on a picture i get the wrong api error.

maybe someone can help me. thank you.
Logged
Pages: 1 ... 5 6 7 8 [9] 10 11 12 13 ... 15   Go Up
 

Page created in 0.034 seconds with 19 queries.