IPTC tags applied incorrectly

Bug #521682 reported by Gianfranco Marino
This bug report is a duplicate of:  Bug #363873: Pb setting IPTC Tags. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Phatch
Confirmed
Undecided
Unassigned

Bug Description

I'm attaching two screenshots:
- the first one shows what I'm trying to do: set the copyright field to "test", and apply a "phatch" tag to the keywords field.
- the second picture shows the result:
1) only the first letter of the tag is inserted in the copyright field,
2) regarding the "keywords" field, the word "phatch" is interpreted as 6 keywords, one for each letter.

Also, since the "keywords" field allows more than one entry, Phatch should ask whether to add to or replace the existing tags.

Revision history for this message
Gianfranco Marino (gianfrancomarino) wrote :
Revision history for this message
Andrea Ambu (andreambu) wrote :

I was able to reproduce this.

This seems to be a problem with the pyexiv2 library, could you check what version are you using? In ubuntu you could just search "pyexiv2" in synaptic and it will show you. I'm using 0.1.3-3build1.

Basically pyexiv2 does something strange with Iptc tags. Some of them are repeatable so it read the iptc values as tuples, if they are not tuples it converts them to tuple.

The interesting part is on lines 657 and 658 of pyexiv2.py where if the tuple has just one item it replaces the tuple with the item. The problem is that if that item is a string (and this is the case) on line 659 it use a for loop and this cause the "char by char" splitting.

Solutions:
  - Comment line 657 and 658 works.
    It doesn't seem a good solution, maybe there is some lib misunderstanding, or it's just a bug on pyexiv2, but anyway it is pyexiv2's code, not phatch's.
  - Replacing "info[tag] = value" at line 49 on actions/write_tag.py with "info[tag] = (value, '')" seems an hack even worse than the previous one but almost work :)

I'm going to ask pyexiv2 guys how it should work.

Andrea

Revision history for this message
Andrea Ambu (andreambu) wrote :

Ok this is a pyexiv 0.1.3 bug.
https://bugs.launchpad.net/pyexiv2/+bug/363873

It will be fixed on pyexiv2 0.2 release.

Changed in phatch:
status: New → Confirmed
Stani (stani)
Changed in phatch:
milestone: none → 0.2.7
milestone: 0.2.7 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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