Implementation of "Rename exif tag action"

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

Bug Description

Tags: patch
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/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:
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  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.