0
votes

My project is to publish images using a phone. I'm using volley library for uploading images and for the back-end side, I'm using Symfony (with file_put_contents and it works) with the liip imagine bundle in order to filter the images. I can see the images uploaded to the folder "web/uploads/img but the filtered images can't be seen in the folder "web/media/cache/{filter}. How can I do in order to get the filtered images with liip imagine?

For the Controller in Symfony:

$file = "uploads/img";
file_put_contents($file, base64_decode($image));

For the bundle liip imagine:

liip_imagine:
   filter_sets:
     thumb:
         quality: 100
         filter:
            thumbnail: { size: [350, 350], mode: inset}
     my_thumb:
         quality: 100
         filter:
         thumbnail: { size: [200, 200], mode: outbound}
1

1 Answers

0
votes

In your services.yaml

parameters:
    image_directory: '%kernel.project_dir%/public/uploads/images'

App\Service\FileUploader:
    arguments:
         $targetDirectory: '%image_directory%'

config/packages/liip_imagine.yaml

liip_imagine:
  filter_sets:
    cache: ~
    my_thumb :
      quality : 75
      filters :
        thumbnail  : { size : [260, 190], mode : outbound }
    post_show:
      quality: 75
      filters:
        thumbnail: { size: [500, 320], mode: outbound }