I started to write a couple of Cocoa applications to play with file extensions and image sizes.

The reason for that is that, often, designers only give you the larger version (the one used for devices with a retina display) of an image and don't add the @2x extension to the file name. I very often found myself renaming a whole bunch of files, opening each of them with Preview, resizing them and changing the name back. This is a tedious process that unfortunately takes a developer off his main task and well, let's face it, wastes his time!

The first application is a command-line application that simply add the @2x extension to all the images (.png .jpg and .jpeg) contained in a folder and copy them in another folder (this one can of course be the same as the original one).

The project is named DDRetinaExtension and you can find the source code on GitHub.

Simply build the project, cd to the folder where the project has been built and run the following command:

$ cd /folder/where/the/built/resides
$ ./RetinaExtension --from /origin/path/ --to /destination/path/

And that's basically it! This will rename all images located in the origin path, add the @2x extension and copy them to the destination path.

I am currently working on a proper Cocoa application that will also integrate the resizing and make this process a bit more friendly!