$ bzr commit -m "added robins wonderful geotag plugin" Committing to: /home/stani/sync/python/phatch/trunk/ added phatch/actions/geotag.py missing phatch/actions/gps.py modified phatch/core/lib/formField.py added phatch/core/lib/gps.py modified phatch/pyWx/lib/popup.py deleted phatch/actions/gps.py Committed revision 687.
Congratulations Robin!!!! Your first action plugin has landed in Phatch. I'm really happy to have you on board. It tastes for more ;-) On Sun, Jun 7, 2009 at 5:30 PM, Nadia Alramli<[email protected]> wrote: > Attached you'll find the gps.py action and the core.lib.gps.py module. I > seperated them into two files. And made very little changes: > Stani added surd to phatch/other so I replaced 'import surd' with 'from > other import surd' I reverted it to 'import surd' as other is automatically added to the sys.path by Phatch. As this is a library file, it should be usable in anywhere and may not have references to Phatch file structure. This is (or should be) true for any file in a lib path. So these are scripts developed for Phatch, but they can be used on their own in programs independent from Phatch. The whole file structure of Phatch is a design. > The action seems to work pretty well! What is left to be done is Stani's job > now. He need to allow meta data to be updated. Thanks for the work! See my comment later ;-) >> I got my code moved over into Phatch-land in one hour !!! No trouble at >> all really. And I understand the interface - makes complete sense. I >> attach the code. It feels so cool for Phatch to have a geotag action. >> You'll see I discovered there's a group the "Geotag Icon >> Project" who are trying to get the whole world to use their icons for this >> purpose. Let's go along with that unless Stani thinks otherwise. > > The icon is good, but I think Stani prefers a shiny one with a transparent > background, to be consistent with the rest of the icons. I'll see if I can > find an alternative icon. You're both right ;-) I like the idea of a standard geotag icon, however it could be phatched by the wonderfull highlight plugin of Nadia to make a bit more shiny. I'm sure she can remaster it well. There is just one important issue. At the moment we can't use the icon yet because the license is creative commons cc-by-sa, which is not compatible with the gpl. I have contact with the project and there is a big chance they might dual license it as well under the GPL. >> I attach the code gps.py and you can pull down the test data if you wish: >> http://clanmills.com/files/gps_test.zip (13mBytes) I did and all worked fine. Note that it makes no sense to place a save action after the geotag action. Let me explain the different possible actionlists: 1) geotag save -> The geo metadata will be stored both inside the source images and the save images. 2) geotag -> The geo metadata will be stored only inside the source images. 3) save geotag -> The geo metadata will be stored only inside the saved messages. If you want not to open and save the file (not losless for jpg), you can better do in this case: copy geotag The reason is that often you want to add metadata to the image without opening and saving it. >> So what's to be done? >> >> Well the script dies at photo.metadata.update(gps_data). The message is >> "photo has no attribute named metadata". >> So I did some messing about and thought "Oh, I'll push back on the others >> about this". It doesn't die any more - but it doesn't add the new meta data >> either. >> >> Do I need to pull down the latest phatch from SVN or somewhere? I suspect >> Stani only added the photo.metadata code last week and it's not in my >> build/version of phatch. Robin, you've got it right. It all worked well. There was no error for me to debug! It seemed that you were working with an older version. Always get the latest version with bazaar (see later). > That's right. You need to have bazaar version control system installed and > then run: > bzr branch lp:phatch You can download bazaar from here for Windows & Mac: http://bazaar-vcs.org/ And for a quick intro: http://doc.bazaar-vcs.org/latest/en/mini-tutorial/index.html > >> >> >> What is the format of gps_data? >> - I guessed a dictionary with [ exiv2-key-string : pyexiv2 data (a string >> or a tuple) ] > > I think so. That makes sense. >> Other wee puzzles (nothing urgent/important here): 1&2 Nadia already answered correctly. >> 3) I was wondering if we get an indicator from phatch when the final image >> is being processed. There is a dialog box shown at the end, at least if you have the latest version ;-) But you're looking for something else... >> If I used this to create a montage or a web gallery, >> I'd want to buffer the data and write the delivery when the last photo is >> processed. Any ideas? > > I don't think there is, but Stani can confirm. Can you give more details on > what you intend the action to do? I think I know what you mean. You want to do some processing on the collections of resulted images, rather than on the images individually. From a technical level this should be very easy to do: just pass the list of filenames and process it. It is more a question how to solve this in the UI. We could define a new category of actions, like with the tag like 'merge' which works on the list of the saved images rather than on them individually. But than we a choice to make. Do these actions return the images individually or let's say that the action makes a montage, instead of looping over all the images, Phatch only continues with the montage image. I don't know if you can follow me. Anyway this is more a design issue than a technical issue.I feel it would be the most logical that after such a merge action, Phatch continues as usual. If your montage actions makes some contact sheets and you would want to process them further with Phatch you could define a separate action list. It would be great if in Phatch you can define a batch of action lists which processes each other previous results. It's hard to explain it in an email. Chat works better. Maybe we can gather in chat about this? >> - No answer is required for the GeoTag project. I'm thinking ahead to the >> next task ! Do you feel working on the time shift action? (See my other email.) It would be nice if you would see how I cleaned up your code. Firstly I follow PEP8 which is the standard convention amongs python programmers. (For example variables and functions are handle_gps, not handleGps, and text lines should not exceed certain lengths). Also one line if else statements are not allowed, as they are not compatible with python2.4 Your firstTime wouldn't have worked as it was defined as a variable for one photo. If you need to work over multiple photos, you use the cache, in this case cache['gps_report']. But overall you did a great job and now we have a working geotag action. Hooray! (But please test it yourself.) > Thank you for being part of our project. We really appreciate your effort. Yes, we really do! Stani PS It is good to keep Phatch development communication on the phatch mailing list as this will be a learning source for future developers. They'll have similar questions. But of course some things are better of private ;-) -- Phatch Photo Batch Processor - http://photobatch.stani.be SPE Python IDE - http://pythonide.stani.be _______________________________________________ Mailing list: https://launchpad.net/~phatch-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~phatch-dev More help : https://help.launchpad.net/ListHelp

