New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@smartface/image-processor

Package Overview
Dependencies
Maintainers
7
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartface/image-processor

iOS, Android image processor with different scales

0.0.2
npm
Version published
Weekly downloads
1
-75%
Maintainers
7
Weekly downloads
 
Created
Source

@smartface/image-processor · npm version

You can generate imageset for iOS and drawables for Android

Installation

npm i -g @smartface/image-processor

Example Usage.

USAGE: sfImageProcessor [options]

sfImageProcessor  --srcImage [IMAGE-PATH] --destiOSFolder [DEST_IOS_FOLDER] --destAndroidFolder [DEST_ANDROID_FOLDER]

--srcImage         : must be absolute path (required)
--destiOSFolder    : must be absolute path (required)
--destAndroidFolder: must be absolute path (required)
--scaleFactor      : scale factor of given 'srcImage' float value ( 1.5, 3) (optional)
--delete           : flag -> delete images from 'destiOSFolder' and 'destAndroidFolder' (optional)

Description

  • parse srcImage
    • image(.$(OS))(.$(SCALE)).png
  • generate images by $(OS) and $(SCALE)

generates image which has same scale or less than given scale

If $(SCALE) value is missing, scale value will be 3x as default

Example Input & Output

srcImage=smartface.png

sfImageProcessor --srcImage=/images/smartface.png --destAndroidFolder=/android --destiOSFolder=/ios

it generates listed images shown in the below.

  • /ios/smartface.imageset
    • smartface.png
    • smartface@2x.png
    • smartface@3x.png
  • /android/drawable-mdpi/smartface.png
  • /android/drawable-hdpi/smartface.png
  • /android/drawable-xhdpi/smartface.png
  • /android/drawable-xxhdpi/smartface.png

srcImage=smartface.ios.png

sfImageProcessor --srcImage=/images/smartface.ios.png --destAndroidFolder=/android --destiOSFolder=/ios

it generates listed images shown in the below.

srcImage=smartface.ios.2x.png

sfImageProcessor --srcImage=/images/smartface.ios.2x.png --destAndroidFolder=/android --destiOSFolder=/ios

it generates listed images shown in the below.

srcImage=smartface.android.4x.png

sfImageProcessor --srcImage=/images/smartface.android.4x.png --destAndroidFolder=/android --destiOSFolder=/ios

it generates listed images shown in the below.

  • /android/drawable-mdpi/smartface.png
  • /android/drawable-hdpi/smartface.png
  • /android/drawable-xhdpi/smartface.png
  • /android/drawable-xxhdpi/smartface.png
  • /android/drawable-xxxhdpi/smartface.png

Note

If --delete flag is true, it deletes them instead of generating.

Keywords

smartface

FAQs

Package last updated on 22 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts