diff --git a/composer.json b/composer.json index 3b924c9f59..87eaa4dde5 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,10 @@ { "type": "vcs", "url": "https://github.com/nlegoff/Media-Alchemyst" + }, + { + "type": "vcs", + "url": "https://github.com/nlegoff/Imagine" } ], "minimum-stability" : "dev", @@ -37,7 +41,7 @@ "alchemy/geonames-api-consumer" : "~0.1.0", "goodby/csv" : "~1.0", "guzzle/guzzle" : "~3.0", - "imagine/imagine" : "0.6.x-dev@dev", + "imagine/imagine" : "dev-flatten-layer as 0.6.1", "jms/serializer" : "~0.10", "justinrainbow/json-schema" : "~1.3", "mediavorus/mediavorus" : "dev-fix-video-dim as 0.4.3", diff --git a/composer.lock b/composer.lock index 456f1504a6..13b332a281 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "750b57fb39506c69b9f7c63097f9160b", + "hash": "748dacbcdc2199ab5eed1a237bf4fd17", "packages": [ { "name": "alchemy-fr/tcpdf-clone", @@ -1214,16 +1214,16 @@ }, { "name": "imagine/imagine", - "version": "dev-develop", + "version": "dev-flatten-layer", "source": { "type": "git", - "url": "https://github.com/avalanche123/Imagine.git", - "reference": "237ccf205dd5ece7a00a574b4f18bd118aa08a5d" + "url": "https://github.com/nlegoff/Imagine.git", + "reference": "df2d9d8834d32943082fc52b89c5b11fde279b5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/237ccf205dd5ece7a00a574b4f18bd118aa08a5d", - "reference": "237ccf205dd5ece7a00a574b4f18bd118aa08a5d", + "url": "https://api.github.com/repos/nlegoff/Imagine/zipball/df2d9d8834d32943082fc52b89c5b11fde279b5a", + "reference": "df2d9d8834d32943082fc52b89c5b11fde279b5a", "shasum": "" }, "require": { @@ -1240,7 +1240,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.6-dev" + "dev-develop": "0.7-dev" } }, "autoload": { @@ -1248,7 +1248,6 @@ "Imagine": "lib/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1267,7 +1266,10 @@ "image manipulation", "image processing" ], - "time": "2013-10-26 10:53:02" + "support": { + "source": "https://github.com/nlegoff/Imagine/tree/flatten-layer" + }, + "time": "2014-07-07 17:04:15" }, { "name": "jms/metadata", @@ -1496,12 +1498,12 @@ "source": { "type": "git", "url": "https://github.com/nlegoff/Media-Alchemyst.git", - "reference": "e812e631b74ebb0c7b3dd5f4e981d84a7b3c4029" + "reference": "be5c7cd4e207c469fb88d88397bd220c4db323d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nlegoff/Media-Alchemyst/zipball/e812e631b74ebb0c7b3dd5f4e981d84a7b3c4029", - "reference": "e812e631b74ebb0c7b3dd5f4e981d84a7b3c4029", + "url": "https://api.github.com/repos/nlegoff/Media-Alchemyst/zipball/be5c7cd4e207c469fb88d88397bd220c4db323d8", + "reference": "be5c7cd4e207c469fb88d88397bd220c4db323d8", "shasum": "" }, "require": { @@ -1563,7 +1565,7 @@ "support": { "source": "https://github.com/nlegoff/Media-Alchemyst/tree/master" }, - "time": "2014-06-10 13:51:13" + "time": "2014-07-07 16:54:32" }, { "name": "mediavorus/mediavorus", @@ -4014,6 +4016,12 @@ } ], "aliases": [ + { + "alias": "0.6.1", + "alias_normalized": "0.6.1.0", + "version": "dev-flatten-layer", + "package": "imagine/imagine" + }, { "alias": "0.4.3", "alias_normalized": "0.4.3.0", diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Image.php b/lib/Alchemy/Phrasea/Media/Subdef/Image.php index 17c03951a1..58d81a630f 100644 --- a/lib/Alchemy/Phrasea/Media/Subdef/Image.php +++ b/lib/Alchemy/Phrasea/Media/Subdef/Image.php @@ -25,6 +25,7 @@ class Image extends Provider const OPTION_RESOLUTION = 'resolution'; const OPTION_STRIP = 'strip'; const OPTION_QUALITY = 'quality'; + const OPTION_FLATTEN = 'flatten'; protected $options = array(); @@ -33,6 +34,7 @@ class Image extends Provider $this->registerOption(new OptionType\Range(_('Dimension'), self::OPTION_SIZE, 20, 3000, 800)); $this->registerOption(new OptionType\Range(_('Resolution'), self::OPTION_RESOLUTION, 50, 300, 72)); $this->registerOption(new OptionType\Boolean(_('Remove ICC Profile'), self::OPTION_STRIP, false)); + $this->registerOption(new OptionType\Boolean(_('Flatten layers'), self::OPTION_FLATTEN, false)); $this->registerOption(new OptionType\Range(_('Quality'), self::OPTION_QUALITY, 0, 100, 75)); } @@ -59,6 +61,7 @@ class Image extends Provider $this->spec->setDimensions($size, $size); $this->spec->setQuality($this->getOption(self::OPTION_QUALITY)->getValue()); $this->spec->setStrip($this->getOption(self::OPTION_STRIP)->getValue()); + $this->spec->setFlatten($this->getOption(self::OPTION_FLATTEN)->getValue()); $this->spec->setResolution($resolution, $resolution); return $this->spec; diff --git a/lib/classes/databox/subdef.php b/lib/classes/databox/subdef.php index 1aba8d1623..04daf18695 100644 --- a/lib/classes/databox/subdef.php +++ b/lib/classes/databox/subdef.php @@ -305,6 +305,9 @@ class databox_subdef if ($sd->dpi) { $image->setOptionValue(Image::OPTION_RESOLUTION, (int) $sd->dpi); } + if ($sd->flatten) { + $image->setOptionValue(Image::OPTION_FLATTEN, p4field::isyes($sd->flatten)); + } return $image; }