ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: demianill on May 27, 2019, 03:01:57 PM

Title: Digits or string ?
Post by: demianill on May 27, 2019, 03:01:57 PM
Dear Friends, forgive my poor English.

We use the Fotoware suite here at my place of work.
And I do not know why (it was a decision before my coming) we use some user-defined fields.

One of them is the field 50 of the IPTC, the ReferenceNumber. We don't use numbers in this field.
Again, I do not know why, but FotoStation / Fotware allows us to write text in this field, that by definition is a numeric field. For us, this field is mandatory, because it is in it that we inform the classification of our collections of images: whether it is a historical image, whether it is an illustration, whether it is a Imgital photo or a scanned photo, etc.

I have done adjustments and manipulations of data in a massive way using exiftool, which is perfect. However, some of the work needs to be done on Fotostation (which is complex and slow) because of the need to write the collection identification strings in the ReferenceNumber field.

See below the listing of some images, where the ReferenceNumber has been filled through Fotostation and has a text content.

ImgDept-MacPro:_JPG UserPhoto$ exiftool -Referencenumber Img4696*.jpg
======== Img46960.jpg
Reference Number                : HistoricalPhoto
======== Img46961.jpg
Reference Number                : HistoricalPhoto
======== Img46962.jpg
Reference Number                : HistoricalPhoto
======== Img46963.jpg
Reference Number                : HistoricalPhoto
======== Img46964.jpg
Reference Number                : HistoricalPhoto
======== Img46965.jpg
Reference Number                : HistoricalPhoto
======== Img46966.jpg
Reference Number                : HistoricalPhoto
======== Img46967.jpg
Reference Number                : HistoricalPhoto
======== Img46968.jpg
Reference Number                : HistoricalPhoto
======== Img46969.jpg
Reference Number                : HistoricalPhoto
   10 image files read

exiftool -Referencenumber="HistoricalIMAGE" Img46961.jpg
Warning: Non-numeric characters in value for IPTC:ReferenceNumber
Nothing to do.



When I try to report new content, also text, using Exiftool, a message appears stating that I have tried to enter a non-numeric value, which is Exiftool's expected behavior.

The question: Is it possible to change the type/format of an IPTC field, changing, in my case in particular, from Digits to String ?

Thanks a lot !!!!!!!!

Title: Re: Digits or string ?
Post by: StarGeek on May 27, 2019, 03:23:10 PM
It's not my area of expertise, but check out the example config file (https://exiftool.org/config.html).  If you go to the "Example 4.  IPTC:NewIPTCTag" section, you can probably copy that section directly into your .exiftool_config file.  Change 160 to 50, "NewIPTCTag" to "ReferenceNumber", and edit the string length.

Though I could be wrong and if so, Phil or Hayo will be along shortly to correct me :)
Title: Re: Digits or string ?
Post by: Phil Harvey on May 27, 2019, 03:56:52 PM
StarGeek's instructions should work, but note that this goes against the IPTC specification and writing values like this may confuse/crash other applications.

- Phil
Title: Re: Digits or string ?
Post by: demianill on May 29, 2019, 06:18:50 AM
Dear StarGeek and Phil,

the solution proposed by StarGeek worked perfectly. Of course, Phil's concerns about possible conflicts with other applications is quite worrying. For now, my need to circumvent Fotostation and apply changes in a massive way with Exiftool is fully taken care of.

Thank you for your help !