I have a folder of images. All have the JPG extension but when running file against a few, they're coming back as bitmap e.g.
25818.jpg: PC bitmap, Windows 3.x format, 357 x 500 x 24 My question is how would I loop through all the images, check whether it's a bitmap file and then convert it to a JPG?
The command I'd use in a single case would be the following but not sure how I'd do the checks and loop through the files
mogrify -format jpg 25818.jpg Thanks
fileto determine the format?identifywould be safer for determining the image format (if I remember correctly, it was a decade since I used ImageMagick).