GP SoftwareTwitter
Opus FAQsManualCommandsObjects

How to distinguish webp and jpg files

Often, when I search image in google image, right clic it to save it, files have extension jpg but it's webp files.
2020-03-26_085131
How to distinguish webp/jpg in DO ?

The WebP plugin only recognises images by extension currently. You could use a script/column that checks for the bytes you've highlighted, or which runs a file-id tool (there's a script for that on the forum, I think), but there's nothing built-in that would do it.

Can I have an example please ? I don't found it.

Not sure if there are any good examples that do similar things, but the Blob object has methods for comparing binary data in files.

ExifTool can easily set the correct extension based on the file type:

@nodeselect
exiftool.exe "-filename<%%f.${FileTypeExtension}" -@ {allfilepath|filem}
1 Like