News for hackers. Stuff that matters.
Re:mpv a free, open-source, and cross-platform media player by latexr on Sunday August 18, 2024 @08:27AM (#41281935)
> The shell script idea is neat.

Could be something as simple as:

  file_path="${1}"
  mime="$(file --mime-type --brief "${file_path}")"
  ext="${mime#image/}"
  mv "${file_path}" "${file_path%.*}.${ext}"
That does no checks (e.g. is the file an image) and may not work on something on something like a video, but it’ll do for common image types such as png, jpeg, webp, heic, gif…

There are no comments on this comment yet.