Can exiftool append correct Extension to an extensionless file?

Started by ziongates, April 29, 2020, 04:22:24 PM

Previous topic - Next topic

ziongates

Greetings Gurus, I have a folder with numerous files without extensions.
Can Exiftool determine the proper extension of a image file and rename the file (anonymous to anonymous .webp)?

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ziongates

Greetings Stargeek that seems like exactly what I seek to accomplish, however the command is not working on Windows OS. I tried to change the single quotes to double quotes however it's saying '1 directory read zero changes'

exiftool -ext "*" "-FileName< %%f.$FileTypeExtension" "-FileName<${CreateDate;$self->GetValue(MIMEType)=~/image|video/ or undef $_}.$FileTypeExtension" -r -d %%Y-%%m-%%d-%%H%%M%%S%%-c "D:\APPZ\exiftool-11.97\yyu\"

I got the code below to work though, thanks Stargeek.
exiftool -ext "*" "-FileName<%%f.$FileTypeExtension" -r "D:\APPZ\exiftool\test"

Phil Harvey

Try this:

exiftool -ext "*" "-FileName<%f.$FileTypeExtension" "D:\APPZ\exiftool-11.97\yyu\"

There was a problem with the "%" characters in your command, plus it renamed the files according to the date, which you didn't say that you wanted.

Also, be sure the files are in the specified directory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ziongates

Thank you for your help, mission accomplished, this is a GREAT app!