Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martan03/ph-p-otoresizor
PHP image resize
https://github.com/martan03/ph-p-otoresizor
image image-resize image-resizer php
Last synced: about 1 month ago
JSON representation
PHP image resize
- Host: GitHub
- URL: https://github.com/martan03/ph-p-otoresizor
- Owner: Martan03
- License: mit
- Created: 2022-09-24T15:26:19.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-24T15:58:42.000Z (about 2 years ago)
- Last Synced: 2024-04-24T09:11:49.177Z (8 months ago)
- Topics: image, image-resize, image-resizer, php
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ph(p)oto Resizor
## Usage:
First you ned to require ImgResize.php and create new ImgResize variable:
```php
require("ImgResize.php");
$imgResize = new ImgResize();
```
And now you can start using 'resize' function to resize your images:
```php
$imgResize->resize(string $imgPath,
int $widthTo,
int $heightTo,
string $nameTo = "",
string $pathTo = "",
bool $crop = false);
```
### **Parameters of the function:****imgPath**:
- path to your image you want to resize**widthTo**:
- width you want your image to be resized to**heightTo**:
- height you want your image to be resized to**nameTo**:
- name you want your image to be named to
- if not given, image will be named "min-" + original image name**pathTo**:
- path you want your image to be saved to
- if not given, image will be placed in root directory**crop**:
- set "true" if you want to crop your image, default "false"### Example of usage:
```php
$imgResize->resize("myImage.png", 200, 200, "resizedImage", "resizedImages");
```**Supported file types:** jpeg, jpg, png