Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactivation and Dependency Updates #180

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 25 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,35 @@
version: 2
version: 2.1

orbs:
node: circleci/node@5.0.2

jobs:
build:
docker:
- image: circleci/node:10
environment:
CODECOV_TOKEN: 5aade52f-653e-4539-aa00-137db7c15586
working_directory: ~/repo
build_and_test:
executor: node/default
environment:
CODECOV_TOKEN: 5aade52f-653e-4539-aa00-137db7c15586
steps:
- checkout
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
test:
docker:
- image: circleci/node:10
environment:
CODECOV_TOKEN: 5aade52f-653e-4539-aa00-137db7c15586
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- node/install-packages:
pkg-manager: npm
- run:
command: npm run lint
name: Lint code
- run:
name: commitlint
command: ./node_modules/.bin/commitlint --from HEAD~1 --to HEAD --verbose

# TODO: Enforce eslint, commit message format, run coverage checks
# TODO: Add awesome_bot to check URLs in markdown files
# https://github.com/dkhamsing/awesome_bot
# machine:
# ruby:
# version: 2.4.1
# test:
# pre:
# - gem install awesome_bot
# override:
# - awesome_bot README.md
name: Commit Linting
- run:
command: npm run test
name: Run tests
- persist_to_workspace:
root: ~/repo
paths: .

workflows:
version: 2
build-and-test:
build_and_test_workflow:
jobs:
- build
- test:
requires:
- build
- build_and_test:
filters:
branches:
ignore: master
ignore:
- master
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Removed - for now, removed features.
Fixed - for any bug fixes.
Security - in case of vulnerabilities. -->

## [[0.7.0] - 2024-08-11](https://github.com/sebinbenjamin/image-res-generator/compare/0.6.2...0.7.0)

### Changed
- After being archived for 2 years, the project has been reactivated.
- Updated all dependencies and development tools to their latest versions to ensure compatibility and security.

### Security
- Addressed potential vulnerabilities by upgrading outdated dependencies.

### Note
- Additional changes and improvements will follow soon.

## [[0.6.2] - 2019-07-20](https://github.com/sebinbenjamin/image-res-generator/compare/0.6.1...0.6.2)

### Added (dev-features)
Expand Down
93 changes: 52 additions & 41 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

155 changes: 81 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,153 +1,160 @@
# image-res-generator

[![CircleCI build status](https://img.shields.io/circleci/build/github/sebinbenjamin/image-res-generator.svg)](https://circleci.com/gh/sebinbenjamin/image-res-generator)
[![Codeclimate Issues](https://img.shields.io/codeclimate/issues/sebinbenjamin/image-res-generator.svg)](https://codeclimate.com/github/sebinbenjamin/image-res-generator/issues)
[![Codeclimate Maintainability](https://img.shields.io/codeclimate/maintainability-percentage/sebinbenjamin/image-res-generator.svg)](https://codeclimate.com/github/sebinbenjamin/image-res-generator/maintainability)
[![Depfu](https://badges.depfu.com/badges/e26d90ff99e9d1681c0e0029b003cb9f/overview.svg)](https://depfu.com/github/sebinbenjamin/image-res-generator?project_id=8520)
[![Gitter Chay](https://img.shields.io/gitter/room/sebinbenjamin/image-res-generator.svg?color=blue)](https://gitter.im/image-res-generator/community)
[![Gitter Chat](https://img.shields.io/gitter/room/sebinbenjamin/image-res-generator.svg?color=blue)](https://gitter.im/image-res-generator/community)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

## Introduction

Automatic icon and splash screen resizing tool. Helpful for quickly generating image assets for **Angular**/**Ionic**/**Capacitor**/**Cordova**/**PhoneGap** apps, PWAs and general use.

It automatically resizes and copies your ```icon.png``` and ```splash.png``` files to the platform dedicated directories.
**image-res-generator** is an automatic icon and splash screen resizing tool designed for **Angular**, **Ionic**, **Capacitor**, **Cordova**, **PhoneGap** apps, PWAs, and general use. It resizes and copies your `icon.png` and `splash.png` files to the platform-specific directories.

---
<!-- ## Installation

$ npm install image-res-generator -g
--- -->
## Installation

To install the image-res-generator globally, run:

```bash
npm install -g image-res-generator
```

This will make the `irgen` command available globally on your system.

---

## Usage
### Required files

Add your ```icon``` and ```splash``` files to the 'resources' folder under the root of your project. Make sure they are at least (1024px x 1024px) for icons and (2732px x 2732px) for splash images.
### Required Files

Place your `icon` and `splash` files in the 'resources' folder under the root of your project. Ensure they are at least 1024x1024 pixels for icons and 2732x2732 pixels for splash images.

```
resources/
├── icon.png
└── splash.png
```

**Update** : You could now use `SVG` vector images for the same 🎉.
**Update**: You can now use `SVG` vector images for both icon and splash files 🎉.

```
resources/
├── icon.svg
└── splash.svg
```
While creating a base splash image, make sure that the splash screen's artwork roughly fits/covers a square (1200x1200) at the center of the image (2732x2732).

<img src="https://user-images.githubusercontent.com/4099066/82296073-bd052880-9a04-11ea-9ee7-199b6dc1e826.jpg" width="75%">
When creating a base splash image, ensure that the artwork fits within a square (1200x1200) at the center of the image (2732x2732).

![Splash Screen Template](https://user-images.githubusercontent.com/4099066/82296073-bd052880-9a04-11ea-9ee7-199b6dc1e826.jpg)

You can use this [template](https://code.ionicframework.com/resources/splash.psd) provided by the Ionic team for easier splash creation.

### Command Line Usage

### Command line
To generate resized images, use:

```bash
$ image-res-generator
$ image-res-generator
```
or

```bash
$ irgen
$ irgen
```

**ATTENTION:** while preserving source files, it overwrites previous output if any.
**Note:** While preserving source files, it overwrites previous output if any.

### Options

-V, --version output the version number
-i, --icon [optional] optional icon file path
(default: ./resources/icon.png)
-s, --splash [optional] optional splash file path
(default: ./resources/splash.png)
-p, --platforms [optional] optional platform token comma separated list
available tokens: android, ios, windows, blackberry10, pwa
(default: all platforms processed)
-o, --outputdir [optional] optional output directory
(default: ./resources/)
-I, --makeicon [optional] option to process icon files only
-S, --makesplash [optional] option to process splash files only
-c, --crop[optional] option to crop images, instead of the default 'resize' strategy.
-h, --help output usage information
-d, --debug output debugging information
```bash
-V, --version output the version number
-i, --icon [optional] optional icon file path
(default: ./resources/icon.png)
-s, --splash [optional] optional splash file path
(default: ./resources/splash.png)
-p, --platforms [optional] optional platform token comma-separated list
available tokens: android, ios, windows, blackberry10, pwa
(default: all platforms processed)
-o, --outputDir [optional] optional output directory
(default: ./resources/)
-I, --makeIcon [optional] option to process icon files only
-S, --makeSplash [optional] option to process splash files only
-c, --crop [optional] option to crop images instead of the default 'resize' strategy
-h, --help output usage information
-d, --debug output debugging information
```

---

## Do yourself a favor
## Best Practices

Add to your package.json a script definition to match your file generation needs.
This way, you won't have to repeat the whole command along with the options.
### Automate with NPM Scripts

### An example
Add a script to your `package.json` to automate the image generation process with specific options. This saves time and avoids repetitive command typing.

{
...
"scripts": {
...
"resgen": "irgen -p android,ios"
}
}
Example:

All you have to do then is type :
```json
{
"scripts": {
"resgen": "irgen -p android,ios"
}
}
```

npm run resgen
Now, you can run:

NPM will cope with typing the whole command line for you.
```bash
npm run resgen
```

---

## Platforms

Supported platforms:
## Supported Platforms

- **iOS**
- icons
- splash screens
- Icons
- Splash screens
- **Android**
- icons
- splash screens
- Icons
- Splash screens
- **Windows**
- icons
- splash screens
- Icons
- Splash screens
- **Blackberry 10**
- icons
- Icons
- **PWAs**
- icons
- Icons

---

## Upcoming tasks
- Fix installation as an npm package.
- Copy assets to android/ios capacitor folders.
- Add options for Crop resizing strategy
- Update image configurations for all platforms
- Add support for capacitor
## Roadmap

- Copy assets to Android/iOS Capacitor folders.
- Add options for crop resizing strategy.
- Update image configurations for all platforms.
- Add support for Capacitor.

---

## Contributing
Thanks for your interest in contributing!
Read up on our [guidelines](https://github.com/sebinbenjamin/image-res-generator/blob/master/CONTRIBUTING.md) to start contributing.

Thank you for your interest in contributing! Please read our [contributing guidelines](https://github.com/sebinbenjamin/image-res-generator/blob/master/CONTRIBUTING.md) to get started.

---

## Credits
This open-source project is made possible with the help and support of the amazing open-source community. Special thanks to:

* All contributors in this project ✨💚.
* [@olivab][1] for creating and maintaining the original project [cordova-res-generator][2].
* Contributors to [cordova-res-generator][2].
This open-source project is made possible by the support of the amazing open-source community. Special thanks to:

[1]: https://github.com/olivab
[2]: https://github.com/olivab/cordova-res-generator
- All contributors in this project ✨💚.
- [@olivab](https://github.com/olivab) for creating and maintaining the original project [cordova-res-generator](https://github.com/olivab/cordova-res-generator).
- Contributors to [cordova-res-generator](https://github.com/olivab/cordova-res-generator).

---

## License

This project is made available under the terms of the GPLv3.
See the [LICENSE file][license] for the full text of the license.

[license]: https://github.com/sebinbenjamin/image-res-generator/blob/master/LICENSE
This project is licensed under the GPLv3. See the [LICENSE file](https://github.com/sebinbenjamin/image-res-generator/blob/master/LICENSE) for details.
Loading