I have an image archive I keep up. Sometimes, the sites I pull them from reformat the file while keeping the extension the same, most often making PNG images into JPG's that are still named .png.  Is there a way to discover when this has happened and fix it automatically?When on Windows, I used IrfanView for this, but that needs a Wine wrapper.
Finding a file type assuming wrong extension
files;command;utilities;mime types;file command
You can use file tool:$ file file.pngfile.png: PNG image data, 734 x 73, 8-bit/color RGB, non-interlaced$ mv file.png file.txt$ file file.txtfile.txt: PNG image data, 734 x 73, 8-bit/color RGB, non-interlaced