Change .png to .jpg AND change the corresponding json to reflect it.

Started by rd1, March 11, 2023, 12:01:52 PM

Previous topic - Next topic

rd1

I have a large amount of png files that need to be changed to .jpg. The json files corresponding to them look like this: "name.png.json". Therefore I need to change these json files to .jpg.json for the tool to work. I can't figure out how I would do this.

So the process that I want to occur would be like this: Exiftool scans all files and changes png to jpg ONLY if required. Then it finds the json files which go along with those changed png files and renames them to accordingly.

Phil Harvey

ExifTool doesn't process images so it can't be used to change a PNG image to JPG.

But you can use it to rename your JSON files like this:

exiftool "-filename<${filename;s/png/jpg/}" -ext json DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).