I'm trying to rotate a WEBP without having to recompress it.
The best way I can think of is by simply setting metadata to change its orientation.
How do I set the Orientation/Rotation metadata for a WEBP?
I several things with exiftool
and webpmux
, but I just don't seem to get anything to work.
Does WEBP even support Orientation as metadata?
The documentation of webpmux
doesn't mention anything about rotation or orientation.
I used this exiftool on a webp file which writes the EXIF:Orientation
tag (webp supports both EXIF and XMP metadata)
exiftool -Orientation="Rotate 180" file.webp
When viewed with XNViewMP, it was correctly inverted. Irfanview, on the other hand, did not rotate it. Irfanview also didn't display any metadata when checked, so it apparently doesn't read the metadata in webp files and therefor doesn't know the image has to be rotated.
Checking Chrome and Firefox, neither of them rotated the image correctly either.
You might have to check with each of the programs you use to see if they support reading the Orientation
in the file or not.