I
I
Igor2020-12-20 12:27:30
symfony
Igor, 2020-12-20 12:27:30

How to configure liip_imagine in Symfony?

How to configure liip_imagine in Symfony?

Really already boiled up.
It's not even a matter of how to set it up.

Here is the basic configuration.

liip_imagine:
  resolvers:
    default:
      web_path:
        web_root: '%kernel.project_dir%'
        cache_prefix: 'media/cache'

  loaders:
    default:
      filesystem:
        data_root: '%kernel.project_dir%'

  filter_sets:
    # Prototype
    xs:
      cache: ~
      filters:
        relative_resize:
          widen: 200


Like the final URL is localhost:8001/media/cache/xs/media/images/series/...
But hell, sometimes it's localhost:8001/media/cache/resolve/xs/media/images...

Then there appears resolve but it doesn't appear in the real path to the thumbnail image.

Who has a really working config, what could be the matter?

In the controller I do this
foreach ($series as $item) {
      $imagePath = sprintf("%s/%s",  $this->getParameter("app.media_dir.series"), $item->getImage());
      if (!$cacheManager->isStored($imagePath, "xs")) {
        try {
          $bin_data = $dataManager->find("xs", $imagePath);
          $filtered_bin_data = $filterManager->applyFilter($bin_data, "xs");
          $cacheManager->store($filtered_bin_data, $imagePath, "xs");
        } catch (Exception $exception) {
          $e = $exception;
        }
      }
    }


Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question