Skip to content

Commit

Permalink
add background color to subdefs of transparent tiff. (#4376)
Browse files Browse the repository at this point in the history
bump media-alchemyst and imagine
  • Loading branch information
jygaulier authored Sep 19, 2023
1 parent 7d23b76 commit 1bef595
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
"hoa/dispatcher": "~0.0",
"hoa/router": "~2.0",
"igorw/get-in": "~1.0",
"imagine/imagine": "0.9.0",
"imagine/imagine": "^0.10.0",
"jms/serializer": "~0.10",
"jms/translation-bundle": "dev-fix-2021-04-19",
"justinrainbow/json-schema": "2.0.3 as 1.6.1",
"league/flysystem": "^1.0",
"league/flysystem-aws-s3-v2": "^1.0",
"league/fractal": "dev-webgalleries#af1acc0275438571bc8c1d08a05a4b5af92c9f97 as 0.13.0",
"media-alchemyst/media-alchemyst": "^0.5.7",
"media-alchemyst/media-alchemyst": "^4.1.8",
"monolog/monolog": "~1.3",
"mrclay/minify": "~2.1.6",
"neutron/process-manager": "2.0.x-dev@dev",
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/Alchemy/Phrasea/Media/Subdef/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Image extends Provider
const OPTION_WATERMARK = 'watermark';
const OPTION_WATERMARKTEXT = 'watermarktext';
const OPTION_WATERMARKRID = 'watermarkrid';
const OPTION_BACKGROUNDCOLOR = 'backgroundcolor';

protected $options = [];

Expand All @@ -41,6 +42,7 @@ public function __construct(TranslatorInterface $translator)
$this->registerOption(new OptionType\EnumButton($this->translator->trans('Watermark'), self::OPTION_WATERMARK, array('no' => 'no', 'yes' => 'yes'), 'no'));
$this->registerOption(new OptionType\Text($this->translator->trans('Watermark text'), self::OPTION_WATERMARKTEXT, ''));
$this->registerOption(new OptionType\Text($this->translator->trans('Watermark Record_id'), self::OPTION_WATERMARKRID, ''));
$this->registerOption(new OptionType\Text($this->translator->trans('Background Color'), self::OPTION_BACKGROUNDCOLOR, ''));
}

public function getType()
Expand Down Expand Up @@ -69,6 +71,7 @@ public function getMediaAlchemystSpec()
$this->spec->setStrip($this->getOption(self::OPTION_STRIP)->getValue());
$this->spec->setFlatten($this->getOption(self::OPTION_FLATTEN)->getValue());
$this->spec->setResolution($resolution, $resolution);
$this->spec->setBackgroundColor($this->getOption(self::OPTION_BACKGROUNDCOLOR)->getValue());

return $this->spec;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/classes/databox/subdef.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ protected function buildImageSubdef(SimpleXMLElement $sd)
if ($sd->watermarkrid) {
$image->setOptionValue(Image::OPTION_WATERMARKRID, $sd->watermarkrid);
}
if ($sd->backgroundcolor) {
$image->setOptionValue(Image::OPTION_BACKGROUNDCOLOR, $sd->backgroundcolor);
}
return $image;
}
/**
Expand Down

0 comments on commit 1bef595

Please sign in to comment.