Skip to content

Commit e6d05fb

Browse files
committed
Integrate new Image Component
1 parent 38d2158 commit e6d05fb

File tree

11 files changed

+237
-2
lines changed

11 files changed

+237
-2
lines changed

.github/gmagick.sh

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
if [ -z "$1" ]
6+
then
7+
echo "You must provide the PHP version as first argument"
8+
exit 1
9+
fi
10+
11+
if [ -z "$2" ]
12+
then
13+
echo "You must provide the php.ini path as second argument"
14+
exit 1
15+
fi
16+
17+
PHP_VERSION=$1
18+
PHP_INI_FILE=$2
19+
20+
GRAPHICSMAGIC_VERSION="1.3.23"
21+
if [ $PHP_VERSION = '7.0' ] || [ $PHP_VERSION = '7.1' ]
22+
then
23+
GMAGICK_VERSION="2.0.4RC1"
24+
else
25+
GMAGICK_VERSION="1.1.7RC2"
26+
fi
27+
28+
mkdir -p cache
29+
cd cache
30+
31+
if [ ! -e ./GraphicsMagick-$GRAPHICSMAGIC_VERSION ]
32+
then
33+
wget http://78.108.103.11/MIRROR/ftp/GraphicsMagick/1.3/GraphicsMagick-$GRAPHICSMAGIC_VERSION.tar.xz
34+
tar -xf GraphicsMagick-$GRAPHICSMAGIC_VERSION.tar.xz
35+
rm GraphicsMagick-$GRAPHICSMAGIC_VERSION.tar.xz
36+
cd GraphicsMagick-$GRAPHICSMAGIC_VERSION
37+
./configure --prefix=$HOME/opt/gmagick --enable-shared --with-lcms2
38+
make -j
39+
else
40+
cd GraphicsMagick-$GRAPHICSMAGIC_VERSION
41+
fi
42+
43+
make install
44+
cd ..
45+
46+
if [ ! -e ./gmagick-$GMAGICK_VERSION ]
47+
then
48+
wget https://pecl.php.net/get/gmagick-$GMAGICK_VERSION.tgz
49+
tar -xzf gmagick-$GMAGICK_VERSION.tgz
50+
rm gmagick-$GMAGICK_VERSION.tgz
51+
cd gmagick-$GMAGICK_VERSION
52+
phpize
53+
./configure --with-gmagick=$HOME/opt/gmagick
54+
make -j
55+
else
56+
cd gmagick-$GMAGICK_VERSION
57+
fi
58+
59+
make install
60+
echo "extension=`pwd`/modules/gmagick.so" >> $PHP_INI_FILE
61+
php --ri gmagick

.github/imagick.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
if [ -z "$1" ]
6+
then
7+
echo "You must provide the php.ini path as first argument"
8+
exit 1
9+
fi
10+
11+
PHP_INI_FILE=$1
12+
13+
IMAGEMAGICK_VERSION="6.8.9-10"
14+
IMAGICK_VERSION="3.4.3"
15+
16+
mkdir -p cache
17+
cd cache
18+
19+
if [ ! -e ./ImageMagick-$IMAGEMAGICK_VERSION ]
20+
then
21+
wget http://www.imagemagick.org/download/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.xz
22+
tar -xf ImageMagick-$IMAGEMAGICK_VERSION.tar.xz
23+
rm ImageMagick-$IMAGEMAGICK_VERSION.tar.xz
24+
cd ImageMagick-$IMAGEMAGICK_VERSION
25+
./configure --prefix=$HOME/opt/imagemagick
26+
make -j
27+
else
28+
cd ImageMagick-$IMAGEMAGICK_VERSION
29+
fi
30+
31+
make install
32+
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/opt/imagemagick/lib/pkgconfig
33+
ln -s $HOME/opt/imagemagick/include/ImageMagick-6 $HOME/opt/imagemagick/include/ImageMagick
34+
cd ..
35+
36+
if [ ! -e ./imagick-$IMAGICK_VERSION ]
37+
then
38+
wget https://pecl.php.net/get/imagick-$IMAGICK_VERSION.tgz
39+
tar -xzf imagick-$IMAGICK_VERSION.tgz
40+
rm imagick-$IMAGICK_VERSION.tgz
41+
cd imagick-$IMAGICK_VERSION
42+
phpize
43+
./configure --with-imagick=$HOME/opt/imagemagick
44+
make -j
45+
else
46+
cd imagick-$IMAGICK_VERSION
47+
fi
48+
49+
make install
50+
echo "extension=`pwd`/modules/imagick.so" >> $PHP_INI_FILE
51+
php --ri imagick

.travis.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ addons:
1111
- language-pack-fr-base
1212
- ldap-utils
1313
- slapd
14+
- libtiff-dev
15+
- libjpeg-dev
16+
- libdjvulibre-dev
17+
- libwmf-dev
18+
- pkg-config
19+
- liblcms2-dev
1420

1521
env:
1622
global:
@@ -27,15 +33,16 @@ matrix:
2733
- php: 5.5
2834
- php: 5.6
2935
- php: 7.0
30-
env: deps=high
36+
env: deps=high IMAGE_DRIVER=gmagick
3137
- php: 7.1
32-
env: deps=low
38+
env: deps=low IMAGE_DRIVER=imagick
3339
fast_finish: true
3440

3541
cache:
3642
directories:
3743
- .phpunit
3844
- php-$MIN_PHP
45+
- cache
3946

4047
services:
4148
- memcached
@@ -90,6 +97,8 @@ install:
9097
- if [[ ! $skip ]]; then composer update; fi
9198
- if [[ ! $skip ]]; then ./phpunit install; fi
9299
- if [[ ! $skip && ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
100+
- if [[ $IMAGE_DRIVER = imagick ]]; then ./.github/imagick.sh $INI_FILE; fi
101+
- if [[ $IMAGE_DRIVER = gmagick ]]; then ./.github/gmagick.sh $TRAVIS_PHP_VERSION $INI_FILE; fi
93102

94103
script:
95104
- REPORT=' && echo -e "\\e[32mOK\\e[0m {}\\n\\n" || (echo -e "\\e[41mKO\\e[0m {}\\n\\n" && $(exit 1))'

appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ install:
3939
- echo apc.enable_cli=1 >> php.ini-max
4040
- echo extension=php_memcache.dll >> php.ini-max
4141
- echo extension=php_intl.dll >> php.ini-max
42+
- echo extension=php_exif.dll >> php.ini-max
43+
- echo extension=php_gd2.dll >> php.ini-max
4244
- echo extension=php_mbstring.dll >> php.ini-max
4345
- echo extension=php_fileinfo.dll >> php.ini-max
4446
- echo extension=php_pdo_sqlite.dll >> php.ini-max

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
9393
"predis/predis": "~1.0",
9494
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
95+
"symfony/image-fixtures": "dev-master@dev",
9596
"symfony/phpunit-bridge": "~3.2",
9697
"symfony/polyfill-apcu": "~1.1",
9798
"symfony/security-acl": "~2.8|~3.0",
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
composer.lock
2+
phpunit.xml
3+
vendor/
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG
2+
=========
3+
4+
3.3.0
5+
-----
6+
7+
* [EXPERIMENTAL] added the component

src/Symfony/Component/Image/LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016-2017 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

src/Symfony/Component/Image/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Symfony Image Component
2+
=======================
3+
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "symfony/image",
3+
"type": "library",
4+
"description": "Symfony Image Component",
5+
"keywords": [
6+
"image manipulation",
7+
"image processing",
8+
"drawing",
9+
"graphics"
10+
],
11+
"homepage": "https://symfony.com/",
12+
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "Bulat Shakirzyanov",
16+
"email": "mallluhuct@gmail.com",
17+
"homepage": "http://avalanche123.com"
18+
},
19+
{
20+
"name": "Romain Neutron",
21+
"email": "imprec@gmail.com"
22+
},
23+
{
24+
"name": "Symfony Community",
25+
"homepage": "https://symfony.com/contributors"
26+
}
27+
],
28+
"require": {
29+
"php": ">=5.5.9"
30+
},
31+
"require-dev": {
32+
"symfony/image-fixtures": "dev-master@dev"
33+
},
34+
"suggest": {
35+
"ext-gd": "to use the Symfony Image GD implementation",
36+
"ext-imagick": "to use the Symfony Image Imagick implementation",
37+
"ext-gmagick": "to use the Symfony Image Gmagick implementation"
38+
},
39+
"autoload": {
40+
"psr-4": { "Symfony\\Component\\Image\\": "" },
41+
"exclude-from-classmap": [
42+
"/Tests/"
43+
]
44+
},
45+
"minimum-stability": "dev",
46+
"extra": {
47+
"branch-alias": {
48+
"dev-master": "3.3-dev"
49+
}
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
5+
backupGlobals="false"
6+
colors="true"
7+
bootstrap="vendor/autoload.php"
8+
>
9+
<php>
10+
<ini name="error_reporting" value="-1" />
11+
</php>
12+
13+
<testsuites>
14+
<testsuite name="Symfony Image Component Test Suite">
15+
<directory>./Tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
19+
<filter>
20+
<whitelist>
21+
<directory>./</directory>
22+
<exclude>
23+
<directory>./Tests</directory>
24+
<directory>./vendor</directory>
25+
</exclude>
26+
</whitelist>
27+
</filter>
28+
</phpunit>

0 commit comments

Comments
 (0)