← Back to team overview

phatch-dev team mailing list archive

[Bug 386707] Re: Implementation of "Rename exif tag action"

 

I only did some small changes. You forgot a corner case where old_name
== new_name, as than it would delete the tag. No icon needed here, as it
is the same as the rename action. So this one is ready ;-)
Congratulations!

$ bzr diff
=== modified file 'phatch/actions/rename_tag.py'
--- phatch/actions/rename_tag.py	2009-06-15 15:04:39 +0000
+++ phatch/actions/rename_tag.py	2009-06-15 15:05:14 +0000
@@ -34,20 +34,20 @@
     valid_last  = True
 
     def interface(self,fields):
-        fields[_t('Tag (Exif, Iptc)')]= self.ExifItpcField(
+        fields[_t('From (Exif, Iptc)')]= self.ExifItpcField(
             'Exif.Image.Software',choices=self.EXIF_IPTC)
-        fields[_t('Tag (Exif, Iptc) New Name')] = self.ExifItpcField(
+        fields[_t('To (Exif, Iptc)')] = self.ExifItpcField(
             'Exif.Image.Software',choices=self.EXIF_IPTC)
 
     def apply(self,photo,setting,cache):
         info = photo.get_info()#read only
-        old_name = self.get_field('Tag (Exif, Iptc)', info)
-        new_name = self.get_field('Tag (Exif, Iptc) New Name', info)
+        old_name = self.get_field('From (Exif, Iptc)', info)
+        new_name = self.get_field('To (Exif, Iptc)', info)
 
         if new_name.strip() == '':
             return photo
         
-        if old_name in photo.info.keys():
+        if old_name in photo.info.keys() and old_name != new_name:
             photo.metadata[new_name] = photo.info[old_name]
             photo.info[old_name] = None


** Changed in: phatch
       Status: New => Fix Committed

** Changed in: phatch
     Assignee: (unassigned) => Juho Vepsäläinen (bebraw)

-- 
Implementation of "Rename exif tag action"
https://bugs.launchpad.net/bugs/386707
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Fix Committed

Bug description:
This patch implements https://blueprints.launchpad.net/phatch/+spec/rename-exif-tag .



References