Today, I am presenting a very innovative PHP feature in front of you, App Icon Generator for IOS and Android. It may serve as a real great utility for android and iOS developer.
Images are the indistinguishable part of any web or mobile application and it actually proves to be a big challenge for mobile developers and specially for designers to arrange images with varying dimensions and resolutions that may suitably fit for all type of mobile devices.
Auto App Icon Generator for IOS and Android Applications
PHP has come up a magical package with name Morgen.
This package is configured in such a wonderful way to automatically generate images/icons of varying types and dimensions to cater the icons needs of iOS, android and web applications.
The full code can be downloaded from GitHub, or from official PHP classes website.
You just need to download the package and then you can start using its features. For your understanding, let us have a glance over the main files inside this package.
Path : morgen-2016-08-11\demo\media
In this folder you will place the images/icons to be converted into those required for all the platforms mentioned above. By default, it contains 3 images, one. PNG, one .JPG and one .SVG type.
Path: morgen-2016-08-11\demo\ morgen-demo.php
This is the main file which you need to execute. After executing this file ,there will be automatically created two folders inside the demo folder:
greatApp: This folder will contain the auto-generated icons in the forms, required for android applications.
ios-greatApp: This folder contains the auto-generated icons in the forms, required for iOS devices applications.
Now a worth mentioning point here is that you need to install Inkscape on your system. It is required to deal with images having .svg extension. Also its installation path is to be input into morgen-demo.php file.
morgen.php: The main file containing the definition of IconGenerator class.
project-greatApp.xml and morgen.cfg.xml are the configuration files, where you may make changes as per your need.
e.g Using default configuration settings in project-greatApp.xml, the ios-greatApp folder will only contain the .svg type conversions, otherwise empty.
I have modified this file, so that ios-greatApp folder may also get the converted images of types other than .svg also and for two more device types i.e. ipad, retina-ipad now.
<?xml version="1.0" encoding="UTF-8"?>
<!-- "greatApp" project definition file -->
<project name="greatApp" sourceFolder="media/">
<branch type="android" destinationFolder="greatApp/resources/">
<branch type="ios" destinationFolder="ios-greatApp/resources/">
<image mask="" devices="iphone,iphone-2x,ipad,retina-ipad" />
Likewise, you may also make any configuration changes in these two xml files as per your requirement.
Hope, it will prove to be a great help for iOS and android application developers. Thanks