WEBP conversion issue

Started by GroupNebula563, July 26, 2024, 05:28:20 PM

Previous topic - Next topic

GroupNebula563

I'm moving some content from one site to the other. The issue is, that site encoded uploaded WEBPs as arbitrary file formats (pngs and jpgs) and that's the only way to get them back from the first site. The second site already has those WEBP file names set in stone, so I'll need to upload the files with that extension. Is there a way to automatically detect the MIME type of a file and then convert it from that format to an actual WEBP while keeping the file name and extension intact? If it helps, I'm using Windows but can boot to a Linux environment if needed. Thanks! :)

Phil Harvey

ExifTool can detect the file format of the file:

exiftool -filetype FILE

but you will need some other program (imagemagick say?) to do the conversion.

- 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 ($).

StarGeek

On Windows, Irfanview can convert images to WebP in batch. Open the program and hit "B" and the batch convert dialog will open up.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

GroupNebula563

Quote from: StarGeek on July 27, 2024, 12:36:37 AMOn Windows, Irfanview can convert images to WebP in batch. Open the program and hit "B" and the batch convert dialog will open up.
Got it, thanks! Sorry for the late response, I figured I'd get email notifications of this sort of thing.

GroupNebula563

Quote from: Phil Harvey on July 26, 2024, 08:21:36 PMExifTool can detect the file format of the file:

exiftool -filetype FILE

but you will need some other program (imagemagick say?) to do the conversion.

- PHil
Got it. Is there a command that will go about renaming all the files to their correct extensions without modifying any other part of the file name? (I've tried some other commands and a lot of them have messed with files that have dots in their file names.

Phil Harvey

Try this command:

exiftool "-filename<%f.$filetypeextension" DIR

- 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 ($).

StarGeek

Quote from: GroupNebula563 on August 09, 2024, 08:08:49 AMGot it, thanks! Sorry for the late response, I figured I'd get email notifications of this sort of thing.

You can either set notifications on a per thread or sub-forum basis in the upper right


Or on all of your posts in the upper left
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

GroupNebula563

Quote from: StarGeek on August 09, 2024, 09:55:57 AM
Quote from: GroupNebula563 on August 09, 2024, 08:08:49 AMGot it, thanks! Sorry for the late response, I figured I'd get email notifications of this sort of thing.

You can either set notifications on a per thread or sub-forum basis in the upper right


Or on all of your posts in the upper left

Got it, thanks!