Implementation of "Rename exif tag action"

Bug #386707 reported by Juho Vepsäläinen
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juho Vepsäläinen

Bug Description

Revision history for this message
Juho Vepsäläinen (bebraw) wrote :
Revision history for this message
Stani (stani) wrote :

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/'
--- phatch/actions/ 2009-06-15 15:04:39 +0000
+++ phatch/actions/ 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(
- fields[_t('Tag (Exif, Iptc) New Name')] = self.ExifItpcField(
+ fields[_t('To (Exif, Iptc)')] = self.ExifItpcField(

     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
+ if old_name in and old_name != new_name:
             photo.metadata[new_name] =[old_name]
   [old_name] = None

Changed in phatch:
assignee: nobody → Juho Vepsäläinen (bebraw)
status: New → Fix Committed
Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints