https://github.com/alexrogalskiy/github-action-image-resizer
📰 GitHub action for images resizing
https://github.com/alexrogalskiy/github-action-image-resizer
github-actions image-resizing
Last synced: 2 months ago
JSON representation
📰 GitHub action for images resizing
- Host: GitHub
- URL: https://github.com/alexrogalskiy/github-action-image-resizer
- Owner: AlexRogalskiy
- License: gpl-3.0
- Created: 2021-03-23T00:33:07.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T05:37:13.000Z (7 months ago)
- Last Synced: 2024-11-24T18:52:06.673Z (7 months ago)
- Topics: github-actions, image-resizing
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/image-resizer
- Size: 31 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 314
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
- Support: .github/support.yml
Awesome Lists containing this project
README
# *Image Resizer*
> GitHub Action to resize images (jpeg, png, webp, avif, tiff, gif, svg) from file/url
[](https://github.com/marketplace/actions/image-resizer)
[](https://github.com/lekterable/perfekt)
[](https://github.com/prettier/prettier)

[](https://houndci.com)
[](https://github.com/AlexRogalskiy/github-action-image-resizer/discussions)[](https://deepsource.io/gh/AlexRogalskiy/github-action-image-resizer/?ref=repository-badge)
[](https://deepscan.io/dashboard#view=project\&tid=11946\&pid=16314\&bid=347248)











[](https://renovatebot.com/)
[](https://dependabot.com/)
[](https://newreleases.io/github/AlexRogalskiy/github-action-image-resizer)
[](https://hitsofcode.com/github/alexrogalskiy/github-action-image-resizer?branch=master/view?branch=master)
[](https://david-dm.org/AlexRogalskiy/github-action-image-resizer)
[](https://david-dm.org/AlexRogalskiy/github-action-image-resizer?type=dev)[](https://app.codeac.io/github/AlexRogalskiy/github-action-image-resizer)
[](https://coveralls.io/github/AlexRogalskiy/github-action-image-resizer?branch=master)
[](https://codebeat.co/projects/github-com-alexrogalskiy-github-action-image-resizer-master)
[](https://lgtm.com/projects/g/AlexRogalskiy/github-action-image-resizer/alerts/)
[](https://lgtm.com/projects/g/AlexRogalskiy/github-action-image-resizer/context:javascript)
[](https://codecov.io/gh/AlexRogalskiy/github-action-image-resizer)
[](https://github.com/AlexRogalskiy/github-action-image-resizer/actions/workflows/build.yml)
[](https://circleci.com/gh/AlexRogalskiy/github-action-image-resizer)
[](https://github.com/marketplace/actions/super-linter)
[](http://commitizen.github.io/cz-cli/)
[][repo]
[![Public workflows that use this action.][total_usages]][search_results]
[![Licence][license_id]][license_content][](https://github.com/AlexRogalskiy/github-action-image-resizer/discussions)
[](https://github.com/AlexRogalskiy/github-action-image-resizer/labels/question)
[](https://github.com/AlexRogalskiy/github-action-image-resizer/labels/bug)## *Table of contents*
- [*Description*](#description)
- [*Inputs*](#inputs)
- [`sourceData`](#sourcedata)
- [`width`](#width)
- [`height`](#height)
- [`quality`](#quality)
- [`formatType`](#formattype)
- [`sourceFile`](#sourcefile)
- [`targetPath`](#targetpath)
- [`targetFile`](#targetfile)
- [*Outputs*](#outputs)
- [`changed`](#changed)
- [*Examples*](#examples)
- [*Visitor stats*](#visitor-stats)
- [*Licensing*](#licensing)
- [*Authors*](#authors)
- [*Versioning*](#versioning)
- [*Contribution*](#contribution)
- [*Acknowledgement*](#acknowledgement)
- [*Forks*](#forks)
- [*Development Support*](#development-support)## *Description*
Provides operations on resizing input images from a file or url (jpeg, png, webp, avif, tiff, gif, svg) by format parameters.
## *Inputs*
### `sourceData`
**Optional** JSON data source file with action parameters:
#### Complete parameters
```json
[
{
"width": 150,
"height": 250,
"quality": 100,
"formatType": "jpeg",
"sourceFile": "./data/input.jpg",
"targetPath": "./data",
"targetFile": "output.jpg"
},
{
"width": 250,
"height": 250,
"formatType": "png",
"sourceFile": "./data/input2.png",
"targetPath": "./data",
"targetFile": "output2.png"
},
{
"width": 350,
"height": 350,
"formatType": "jpeg",
"sourceFile": "https://lunrjs.com/images/moon.jpg",
"targetPath": "./data"
}
]
```#### Basic parameters
```json
[
{
"width": 150,
"height": 250,
"formatType": "jpeg",
"sourceFile": "./data/input.jpg",
"targetPath": "./data"
},
{
"width": 250,
"height": 250,
"formatType": "png",
"sourceFile": "./data/input2.png",
"targetPath": "./data"
},
{
"width": 350,
"height": 350,
"formatType": "jpeg",
"sourceFile": "https://lunrjs.com/images/moon.jpg",
"targetPath": "./data"
}
]
```### `width`
**Required** Target image width
### `height`
**Required** Target image height
### `quality`
**Optional** Target image quality (should be in range **0-100**)
### `formatType`
**Required** Target image format type (any from the list: **heic**, **heif**, **avif**, **jpeg**, **png**, **raw**, **tiff**, **webp**, **gif**)
### `sourceFile`
**Required** Source input image file or url to fetch content from
### `targetPath`
**Required** Target path to store processed image files
### `targetFile`
**Optional** Target image file name (default **sourceFile**)
## *Outputs*
### `changed`
Image file processing operation status
#### `true`
When input image file successfully processed
#### `false`
When error occurred while processing input image file
## *Examples*
```yml
- name: Resize images
uses: alexrogalskiy/github-action-image-resizer@master
with:
prefix: '\n'
suffix: '\n'
sourceFile: './data/info.md'
placeholder: '[\s\S]*?'
replacement: 'Data Block
'
```Running locally:
- `npm run start:action --action github-action-image-resizer --prefix '\n' --suffix '\n' --sourceFile './data/info.md' --placeHolder '[\s\S]*?' --replacement '
Data Block
'`## *Visitor stats*
[](https://hits.seeyoufarm.com)


## *Licensing*
***Image Resizer*** is distributed under LGPL version 3 or later,
\[[License](https://github.com/AlexRogalskiy/github-action-image-resizer/blob/master/LICENSE)]. LGPLv3 is additional
permissions on top of GPLv3.
## *Authors*
***Image Resizer*** is maintained by the following GitHub team-members:
- [](https://github.com/AlexRogalskiy)
with community support please contact with us if you have some question or proposition.
## *Versioning*
The project uses [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on
this repository][tags].## *Contribution*
[](https://badges.pufler.dev)
Please read
[CONTRIBUTING.md](https://github.com/AlexRogalskiy/github-action-image-resizer/blob/master/.github/CONTRIBUTING.md)
for details on our code of conduct, and the process for submitting pull requests to us
([emoji key](https://allcontributors.org/docs/en/emoji-key)).This project follows the [all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind are welcome](http://makeapullrequest.com)
See also the list of [contributors][contributors] who participated in this project.
## *Acknowledgement*
[][stars]
## *Forks*
[][forkers]
## *Development Support*
Like ***Image Resizer*** ? Consider buying me a coffee :)
[](https://www.patreon.com/alexrogalskiy)
[](https://www.buymeacoffee.com/AlexRogalskiy)
[](https://ko-fi.com/alexrogalskiy)***
[](https://www.typescriptlang.org/)
[](https://github.com/)
[](https://forthebadge.com/)[repo]: https://github.com/AlexRogalskiy/github-action-image-resizer
[tags]: https://github.com/AlexRogalskiy/github-action-image-resizer/tags
[issues]: https://github.com/AlexRogalskiy/github-action-image-resizer/issues
[pulls]: https://github.com/AlexRogalskiy/github-action-image-resizer/pulls
[wiki]: https://github.com/AlexRogalskiy/github-action-image-resizer/wiki
[stars]: https://github.com/AlexRogalskiy/github-action-image-resizer/stargazers
[forkers]: https://github.com/AlexRogalskiy/github-action-image-resizer/network/members
[contributors]: https://github.com/AlexRogalskiy/github-action-image-resizer/graphs/contributors
[license_id]: https://img.shields.io/github/license/AlexRogalskiy/github-action-image-resizer
[license_content]: https://github.com/AlexRogalskiy/github-action-image-resizer/blob/master/LICENSE
[total_usages]: https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3DAlexRogalskiy%2Fgithub-action-image-resizer%26badge%3Dtrue
[search_results]: https://github.com/search?o=desc&q=AlexRogalskiy/github-action-image-resizer+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code