-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lohanidamodar/feat-utopia-image
extracting image library
- Loading branch information
Showing
21 changed files
with
4,539 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
/.vscode/ | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
dist: xenial | ||
|
||
arch: | ||
- amd64 | ||
|
||
os: linux | ||
|
||
language: shell | ||
|
||
notifications: | ||
email: | ||
- team@appwrite.io | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- curl -fsSL https://get.docker.com | sh | ||
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json | ||
- mkdir -p $HOME/.docker | ||
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json | ||
- sudo service docker start | ||
- docker --version | ||
- docker buildx create --use | ||
|
||
install: | ||
- docker-compose build | ||
|
||
script: | ||
- docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
FROM composer:2.0 as step0 | ||
|
||
WORKDIR /src/ | ||
|
||
COPY ./composer.json /src/ | ||
COPY ./composer.lock /src/ | ||
|
||
RUN composer update --ignore-platform-reqs --optimize-autoloader \ | ||
--no-plugins --no-scripts --prefer-dist | ||
|
||
FROM php:7.4-cli-alpine as final | ||
|
||
LABEL maintainer="team@appwrite.io" | ||
|
||
RUN \ | ||
apk update \ | ||
&& apk add --no-cache --virtual .deps \ | ||
make \ | ||
automake \ | ||
autoconf \ | ||
gcc \ | ||
g++ \ | ||
&& apk add --no-cache \ | ||
libstdc++ \ | ||
imagemagick \ | ||
imagemagick-dev \ | ||
&& pecl install imagick \ | ||
&& docker-php-ext-enable imagick \ | ||
&& apk del .deps \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /code | ||
|
||
COPY --from=step0 /src/vendor /code/vendor | ||
|
||
# Add Source Code | ||
COPY ./tests /code/tests | ||
COPY ./src /code/src | ||
COPY ./phpunit.xml /code/phpunit.xml | ||
COPY ./psalm.xml /code/psalm.xml | ||
|
||
CMD [ "sh", "-c", "/code/vendor/bin/phpunit --verbose --configuration /code/phpunit.xml && /code/vendor/bin/psalm --show-info=true" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
FROM composer:2.0 as step0 | ||
|
||
WORKDIR /src/ | ||
|
||
COPY composer.lock /src/ | ||
COPY composer.json /src/ | ||
|
||
RUN composer update --ignore-platform-reqs --optimize-autoloader \ | ||
--no-plugins --no-scripts --prefer-dist | ||
|
||
FROM php:8.0-cli-alpine as step1 | ||
|
||
ENV PHP_IMAGICK_VERSION=master | ||
|
||
RUN \ | ||
apk add --no-cache --virtual .deps \ | ||
make \ | ||
automake \ | ||
autoconf \ | ||
gcc \ | ||
g++ \ | ||
git \ | ||
imagemagick \ | ||
imagemagick-dev | ||
|
||
|
||
RUN \ | ||
## Imagick Extension | ||
git clone https://github.com/Imagick/imagick && \ | ||
cd imagick && \ | ||
git checkout $PHP_IMAGICK_VERSION && \ | ||
phpize && \ | ||
./configure && \ | ||
make && make install | ||
|
||
FROM php:8.0-cli-alpine as final | ||
|
||
LABEL maintainer="team@appwrite.io" | ||
|
||
RUN \ | ||
apk update \ | ||
&& apk add --no-cache --virtual .deps \ | ||
make \ | ||
automake \ | ||
autoconf \ | ||
gcc \ | ||
g++ \ | ||
&& apk add --no-cache \ | ||
libstdc++ \ | ||
imagemagick \ | ||
&& apk del .deps \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /code | ||
|
||
COPY --from=step0 /src/vendor /code/vendor | ||
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ | ||
|
||
# Add Source Code | ||
COPY ./tests /code/tests | ||
COPY ./src /code/src | ||
COPY ./phpunit.xml /code/phpunit.xml | ||
COPY ./psalm.xml /code/psalm.xml | ||
|
||
RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini | ||
|
||
CMD [ "sh", "-c", "/code/vendor/bin/phpunit --verbose --configuration /code/phpunit.xml && /code/vendor/bin/psalm --show-info=true" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,43 @@ | ||
# image | ||
Lite & fast micro PHP library for creating common image manipulations that is **easy to use**. | ||
# Utopia Image | ||
|
||
[![Build Status](https://travis-ci.org/utopia-php/ab.svg?branch=master)](https://travis-ci.com/utopia-php/image) | ||
![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/image.svg) | ||
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord) | ||
|
||
Utopia Image library isLite & fast micro PHP library for creating common image manipulations that is **easy to use**. This library is maintained by the [Appwrite team](https://appwrite.io). | ||
|
||
|
||
## Getting Started | ||
|
||
Install using composer: | ||
```bash | ||
composer require utopia-php/image | ||
``` | ||
|
||
```php | ||
<?php | ||
|
||
require_once '../vendor/autoload.php'; | ||
|
||
use Utopia\Image\Image; | ||
$image = new Image(\file_get_contents('image.jpg')); | ||
$target = 'image_100x100.jpg'; | ||
$image->crop(100, 100); | ||
$image->save($target, 'jpg', 100); | ||
|
||
``` | ||
|
||
## System Requirements | ||
|
||
Utopia Image requires PHP 7.4 or later. We recommend using the latest PHP version whenever possible. | ||
|
||
## Authors | ||
|
||
**Damodar Lohani** | ||
|
||
+ [https://twitter.com/lohanidamodar](https://twitter.com/lohanidamodar) | ||
+ [https://github.com/lohanidamodar](https://github.com/lohanidamodar) | ||
|
||
## Copyright and license | ||
|
||
The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "utopia-php/image", | ||
"description": "A simple Image manipulation library", | ||
"type": "library", | ||
"keywords": ["php","framework","upf","utopia","image"], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Eldad Fux", | ||
"email": "eldad@appwrite.io" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": {"Utopia\\Image\\":"src/Image"} | ||
}, | ||
"require": { | ||
"php": ">=7.4", | ||
"chillerlan/php-qrcode": "4.3.0", | ||
"ext-imagick": "*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.3", | ||
"vimeo/psalm": "4.0.1" | ||
}, | ||
"minimum-stability": "dev" | ||
} |
Oops, something went wrong.