Hi,
I just tried the development version of the exif module to use the GPS data written in the Exif informations of the image I have uploaded. It is possible to get any information but the GPS longitude and latitude. These fields are empty after I have created a new node.
Before you ask the question: yes, the image has GPS coordinates :) Here is an exerpt of the XMP sidecar file:
xmlns:exif='http://ns.adobe.com/exif/1.0/'>
80053/12102
1
0
2007-09-24T13:54:45
0221
0
2
1/400
10/1
0100
560/1
2
151831/49
133209/43
1987526/2085
0
19,14.340000S
23,21.400200E
2.2.0.0
400
5
800
532
0
4563/529
0
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 395858-exif-gpsfields_02.patch | 1.84 KB | zzolo |
| #15 | 395858-exif-gpsfields.patch | 945 bytes | zzolo |
| #10 | exif.patch | 5.52 KB | gerhard killesreiter |
| #5 | exif.patch | 1.7 KB | pomliane |
| Output 2.jpg | 20.2 KB | travel-pictures |
Comments
Comment #1
travel-pictures commentedGreat... Drupal has stripped the XMP-Sidecar-Informations... here they are again:
Comment #2
pomliane commentedHi,
It seems gpslongitude and gpslatitude are left unfilled because of an issue with the type of data : a string is expected but an Array is passed.
Same issue with stable 6.x-1.2 version.
See also : http://drupal.org/node/395836
For a pseudo patch see #3.
Comment #3
pomliane commentedIn exif.module,
line 116, under
$tmp = $node->$field_name;add
line 255 : replace
if ($key == 'gps_latitude') {with
if ($key == 'gpslatitude') {line 256 : replace
$value = _exif_DMS2D($value, $data['gps_gpslatituderef']);with
<$value = _exif_DMS2D($value, $data['gpsgpslatituderef']);line 258 : replace
<if ($key == 'gps_longitude') {with
<if ($key == 'gpslongitude') {line 259 : replace
<$value = _exif_DMS2D($value, $data['gps_gpslongituderef']);with
<$value = _exif_DMS2D($value, $data['gpslongituderef']);With these editions, things seem OK : the Exif admin menu shows GPS data and not the word "Array", latitude and longitude are displayed in CCK fields and the "-" is added when required (CCK fields for latitude reference (gpslatituderef) and longitude (gpslongituderef) reference have to be set up for the content type).
Comment #4
rapsli commentedplease post a patch against the 6-1 version
Comment #5
pomliane commentedHere it is.
Comment #6
rapsli commentedThis patch looks weird... the piece of code you insert is called later on in nodeapi
Comment #7
pomliane commentedIndeed.
But, on my system, without the first part, insertions (from node data) in database fail with SQL warnings/errors.
And the second one is required here to have Long/Lat values displayed in the test page (at least).
Comment #8
emagus commentedsubscribing
Comment #9
gerhard killesreiter commentedPowered by Dreditor.
This part is only needed because the reformat function is called with different sets of data. When called from the admin/settings page, the gps fields look like "gpslongitude", when called during saving the node, they look as here. This is why the reformat function doesn't act on these fields.
Please don't destroy the formatting.
This fixes the admin/settings page but doesn't help node_save.
This patch needs some work, maybe I find some time.
Powered by Dreditor.
Comment #10
gerhard killesreiter commentedHere is a patch that works for me.
Comment #11
rapsli commentedHunk #1 FAILED at 103.
Hunk #2 succeeded at 266 (offset 77 lines).
Hunk #3 succeeded at 275 (offset 77 lines).
Hunk #4 FAILED at 320.
Hunk #5 succeeded at 332 with fuzz 2 (offset 66 lines).
Hunk #6 succeeded at 366 (offset 66 lines).
can you check this again? Applied patch against 6--1
Comment #12
gerhard killesreiter commentedYeah, I started from the released version, my mistake.
I've seen that the dev branch has a exif-location module, should the gps stuff go in there. I am not fond of location.module...
Comment #13
rapsli commentedLets keep the location.module where it is and put the GPS stuff in the main module. I haven't really looked at the location module. I just put it in there, so it can be tested. Probably it would make though sense to get it all into one...
Comment #14
iancawthorne commentedI've tried the patch at #5 and also the latest dev version of the module with the "Exif Location" module.
Both work for me, however in both cases, when the longitude is "west", the value is not being set as negative.
Can anyone help with this?
Comment #15
zzolo commentedNew patch with only the index name fixes, as this is the focus of this issue.
Comment #16
zzolo commentedPlease ignore last patch. The ref fields are not named correctly.
Comment #17
zzolo commentedNew patch for just the gps fields. Though @killes approach of standardizing the arrays is a better approach.
Comment #18
zzolo commentedComment #19
rapsli commentedpatch seems pretty simple. Can anybody else confirm the patch?
Comment #20
kdebaas commentedYes, patch works for me.
Comment #21
rapsli commentedanybody else? I'll commit it with one or two more people confirming the patch
Comment #22
cashwilliams commentedYep, patch working for me. Please commit :D
Comment #23
emagus commentedyeah, works. please commit. Thanx!
Comment #24
rapsli commented... give me to the end of the week
Comment #25
rapsli commented:) ... this patch is already in the dev version...