Troubleshooting “no writeable tags set” error

孤街醉人 提交于 2019-12-11 16:06:50

问题


I'm trying to (ultimately) modify a batch of files but getting stuck in the basics as I try to modify a single file before running a batch command.

If someone could help me troubleshoot the command I'm inputting, that would be fantastic. I'm sure it's something very simple.

Thanks a lot for any help you can provide!

Here's the abbreviated image exif data:

-ExifToolVersion=10.10

-FileName=2018_11_13_1.jpeg

-Directory=.

-FileSize=2.8 MB

-FileModifyDate=2019:07:12 15:40:38-07:00

-FileAccessDate=2019:07:12 15:40:38-07:00

-FileInodeChangeDate=2019:07:23 10:38:02-07:00

-FilePermissions=rw-rw-r--

-FileType=JPEG

-FileTypeExtension=jpg

-MIMEType=image/jpeg

[...]

-ModifyDate=2018:11:13 12:00:53

[...]

-DateTimeOriginal=2018:11:13 12:00:53

-CreateDate=2018:11:13 12:00:53

My current input is: exiftool "-FileModifyDate<$filename00000" ./2018_11_13_1.jpeg

And the error message is:

Warning: No writable tags set from 2018_11_13_1.jpeg

0 image files updated

1 image files unchanged

And the exif data is, of course, unchanged.

I've confirmed that I can write a value to this tag, so there's definitely something going wrong in pulling from the filename.

( Continued from How to compensate for incomplete date/time info in filename )


回答1:


The problem here is that you are trying to write from a tag named filename00000. If you check the example in the other post, you will see that there is a space after Filename. This sets it apart so that exiftool knows which is a tag name and which is other data.

There is possibly an additional problem here, though. Your filename has an extra number that is not the date. When exiftool tries to write the time stamp from the filename, it is going to end up with a value of "2018:11:13 10:00:00", which might become especially problematic if that last digit hits a value of 3 or more, resulting in a timestamp of "2018:11:13 30:00:00".

I would suggest using exiftool's Advanced Formatting Feature (a fancy way of saying that you can use perl code in the command) to strip the excess data. Something like
exiftool "-FileModifyDate<${filename;s/^(.*\d{4}_\d\d_\d\d).*/$1/} 000000" ./2018_11_13_1.jpeg

Though take note, if the filenames are in any other format, then it would require a different command.



来源:https://stackoverflow.com/questions/57169580/troubleshooting-no-writeable-tags-set-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!