In Mac, use shell script to crop all sizes of app icons _linux Shell

Source: Internet
Author: User

It is not a programmer's job to tailor an icon of every size needed to the shelves one at a time before the app is put on the shelves, and using the SIPs tool from the MAC can solve this requirement.
With respect to SIPs, the following information can appear in the terminal directly:

Copy Code code as follows:

SIPs 10.4.4-scriptable image processing system.
This tool are used to query or modify raster image files and ColorSync ICC profiles.
Its functionality can also is used through the "Image Events" AppleScript suite.
Try ' sips--help ' or ' sips--helpproperties ' for help using this tool

It is a script image processing system that can be used to query and modify image files.
The following is just written iOS App icon crop script, saved into a. sh file, in the terminal input SH xx.sh can be executed:
Copy Code code as follows:
#!/bin/sh

Filename= "Icon.png"
Dirname= "Cutimg"
name_array= ("Icon-29.png" "Icon-29@2x.png" "Icon-40@2x.png" "Icon-57.png" "Icon-57@2x.png" "Icon-120.png")
size_array= ("29" "58" "80" "57" "114" "120")

mkdir $dirname

For ((i=0;i<${#name_array [@]};++i)); Todo
M_dir= $dirname/${name_array[i]}
CP $filename $m _dir
Sips-z ${size_array[i]} $m _dir
Done

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.