I often get sets of files from graphic designers for iOS apps. Ensuring that the standard and @2x versions of all the files are present and correct is a bit of a pain, for the artist and for myself. The number of times there's been a mispelling in one of the images has been.. well .. many.
Instead I now ask them to send only the retina versions of the images, without the @2x tag in the filename (this has caused confusion).
I then run this script on the whole folder of files, and out pops a folder containing all the files properly renamed and resized. I use the incredible useful 'sips' command-line application that comes with OSX.
The fiddly bit of this script was working out the new size of non-retina images. Yes, they're half the size, but sips doesn't support percentages.
Credit to (person on superuser.com who I'll find eventually) for the neat sed command to extract the pixel size from the output of sips.
Note: clearly the file extension part can be done better. But it works for me right now.
⭐ Free Workday Training
ReplyDeleteStart your journey with free workday training resources for beginners.
You get a basic understanding of Workday navigation and modules.
Practical examples make learning easier to grasp.
This helps you explore Workday before moving to advanced topics.
Guidance from experts adds extra value to your learning.
Recorded content allows flexible learning.
It is a great first step into Workday technology.
Android training courses focus on structured and practical learning. It explains advanced app development techniques. This android training courses enhance coding standards. It supports real-time exercises. Learners build functional apps. It is dependable.
ReplyDelete