>Well, the problem is that I need to do this for hundreds of JPEG files. Sorry, I didn't say that up front.
You can open them one by one in a loop. Get a list of files, with adir(), then process each of them with the Image object.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)