Last active
December 7, 2022 10:41
-
-
Save gggeek/d43fe620d32dc7bcc07a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$dataManager = $this->getContainer()->get('liip_imagine.data.manager'); | |
$filterManager = $this->getContainer()->get('liip_imagine.filter.manager'); | |
$assetManager = $this->getContainer()->get('eris_fo.assets_manager'); | |
$variationManager = $this->getContainer()->get('eris_fo.assets.variation_generator'); | |
// works using the custom data loader as set in imaginebundle config | |
$fullSizeImagePath = '/images/content/advertising.png'; | |
$filters = $this->getContainer()->getParameter('assets_image_variations'); | |
$targetAssetsBucket = 'images'; | |
foreach ($filters as $filter) { | |
$targetFileName = $variationManager->getVariationFileName($fullSizeImagePath, $filter); | |
//var_dump($targetFileName);exit; | |
$image = $dataManager->find($filter, $fullSizeImagePath); | |
$response = $filterManager->applyFilter($image, $filter); | |
$assetManager->uploadFileContentsToBucket($response->getContent(), $targetFileName, $targetAssetsBucket); | |
} |
a key
updating the gist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What does $filter values refer to? Is '180x146' the key for a configuration somewhere or is it an instruction on its own?