Closed (won't fix)
Project:
Image
Version:
5.x-1.7
Component:
image.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2007 at 21:47 UTC
Updated:
21 Mar 2010 at 16:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedhow about != for clarity?
Is this still true with the latest releases? It should be updating them as it goes...
Why strlen? couldn't you just use if (!trim()) ?
So this uses the pecl module?
If so it really needs to be documented and I'd like to see a hook_enalble in the .install file that posts a warning if the pecl module isn't installed. Otherwise it'll be a support nightmare with people wanting to know why it doesn't work.
I'm sort of torn. It seems useful but because of the library requirement I wonder how many people would be able to use it.
Comment #2
drewish commentedoh sweet jesus you're calling eval() for this? seriously? eval is evil
Comment #3
lewiz commentedNo, it uses PHP Exif stuff, i.e. PHP configured with --enable-exif. The link was to a list of all of the GPS fields used for lon/lat info.
I'll tidy up the bits you pointed out and add an install file to check for the exif module -- first time I've done this so I'm not sure what the procedure is ;)
Comment #4
drewish commentedcool, well first off get rid of that eval!
take a look at hook_enable. it needs to go in a .install file.
i guess you could call method_exists() to see if the function is defined. you can report back to the user using drupal_set_message()
also, throw in a README.txt explaining what the module is and does, how to enable it, etc.
Comment #5
lewiz commentedUpdated patch. This fixes the bits you pointed out.
I didn't mention earlier that current wonky stuff does happen with the $node->locations data. It currently is necessary to call image_load() before reading the Exif data.
The image_location.install does a check for exif_read_data(); if it can't find it, it notifies the user and automatically disables the module.
Bed for me now. Thanks :)
Comment #6
lewiz commentedffs, here's an actual patch :P
Comment #7
lewiz commentedPlease change line 21 to:
if (($node->type != 'image') || (!variable_get('location_maxnum_image', 0))) {This makes sure that locations have been enabled for the image node type.
Thanks.
Comment #8
scott falconer commentedI think the conversion may not be negating S and W coordinates... 84°W should end up as -84. I'm not sure how to do this myself...I took a look at how wikipedia does it here and the code is:
Other than that, it seems to work great.
Comment #9
scott falconer commentedOk, I think I got the S and W coordinates to work..not sure on how legit my code is, but it gets it done. If anyone has any more advice on making this a bit cleaner, let me know...
Starting and line 45:
Comment #10
raintonr commentedSubscribing.
Sounds useful. Could/should this be added to the Exif module somehow though? I'd be interested in seeing something that scans all existing images for when this is first installed.
Comment #11
raintonr commentedI couldn't see where the patches on this thread were supposed to fit so hacked about with the EXIF.module.
Add this into the
caseinexif_nodeapi. Note that there is already a check in that code to ignore anything but images so it wasn't needed.Works here. Could do with more checking of course and perhaps some cleanup, but think this is a more appropriate place for this kind of code.
Comment #12
mawds commentedThe module doesn't work with image_import:
* warning: Invalid argument supplied for foreach() in /htdocs/modules/image/contrib/image_location/image_location.module on line 46.
* warning: Invalid argument supplied for foreach() in /mawdshome/htdocs/modules/location/location.module on line 857.
Can anyone suggest a workaround/bug fix?
Thanks
Comment #13
elyobo commentedI'd also be very interested in using it if it could be made to work with the image import module. Sounds like a great idea :)
Comment #14
rubenk commentedbump. i too would like to see this integrated with all the upcoming geotagging support from things like the iphone and other mobile phones.
Comment #15
elyobo commentedQuick code snippet for reading GPS data from EXIF information... It appears that it's stored in degrees, minutes, seconds format, with the value stored as a fraction, e.g. 121.22 would be stored as 12122/100. The following snippet converts the DMS format to seconds after extracting it from the GPS data, if you don't happen to have the EXIF module to do your converting for you (EXIF requires PEL requires PHP5, which my server isn't running...).
I'll look into integrating this into the code. I'm working with D5, so probably won't be supplying any patches for D6/D7.
Comment #16
elyobo commentedBah, I see that the original patch already included this functionality. Ignore the above.
Comment #17
elyobo commentedComment #18
elyobo commentedI've modified the patch so that it
- deals with N and W correctly (negative decimal numbers)
- works with image import - this requires a trivial change to image.module
See the attached patch.
In order for the image import to work, the location assignment has been split into a second function which is called from the image module (if image_location is enabled). To activate it, the following lines need to be added into image_create_node_from in image.module.
This should be added beneath the section assigning the taxonomy, i.e. beneath this snippet
Comment #19
sunLocation module should integrate with Image module, not the other way around.
Comment #20
summit commentedHi, Would be great if this would be integrated in location 3.dev!
Greetings, Martijn
Comment #21
zzolo commentedThe Exif modules does this well, and has a supplemental exif_location module that does exactly all this. I have not tested this out, but it would be a good place to look.