我正在编写脚本以将IPTC数据添加到图像文件夹。它从EXIF信息中提取日期并将其添加到'Caption'
IPTC标记中。日期后缀(第一,第二,第三,第四等)
date = iptc["DateTimeOriginal"]
date = date.strftime('%A %e %B %Y').upcase
iptc["Caption"] = '%s: %s (%s)' % [date, caption, location]
该脚本除了日期输出:
Sunday 13 October 2013
理想情况下,我想它想的输出:
Sunday 13th October 2013
任何建议,将不胜感激。
解决了,稍微调整了最后一点:将{date}更改为{date_string}会给出正确的输出。非常感谢你! –
就在!我的坏 - 相应地更新! – rmosolgo