I had someone try to tell me this or some similar alternative method once, but for this particular use-case my method seemed faster. Usually I'm viewing the dir with the file in ranger, hit r (shortcut for :open_with ), type mpv, enter, I in mpv for info, q to quit, a in ranger to rename the file with old name pretyped in. It's a pretty smooth workflow. Assuming I start from the same place in ranger I have to press colon and type `shell -w file %s` and hit enter which may or may not be faster but I think is more keystrokes. I could bind it to a key in ranger if I found an open one and then that might be better. It's sometimes weeks between instances of the mis-saved images or else I might've tried harder to optimize this. The shell script idea is neat.
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…