ExifTool Forum

ExifTool => Newbies => Topic started by: rd1 on March 11, 2023, 12:01:52 PM

Title: Change .png to .jpg AND change the corresponding json to reflect it.
Post by: rd1 on March 11, 2023, 12:01:52 PM
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.
Title: Re: Change .png to .jpg AND change the corresponding json to reflect it.
Post by: Phil Harvey on March 11, 2023, 02:01:15 PM
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