Bonjour,

Je tente d'utiliser liip_imagine pour redimensionner une image au téléchargement

Le bundle est installé et fonctionne apparemment correctement. en tous cas, il fonctionne dans les fichiers Twig :
<img src="{{ img | imagine_filter('my_thumb') }}" class="img-responsive frontImages" />
En revanche je désire aussi redimensionner l'image au téléchargement
(Le téléchargement fonctionne.)

mais si je met ce code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$this->file = $form['fichierImage']->getData();
            $name = $this->file->getClientOriginalName(); // nom du fichier
            $this->file->move($dir, $name);  // dans 
 
            $container = $this->container;                                  // the DI container
            $dataManager = $container->get('liip_imagine.data.manager');    // the data manager service
            $filterManager = $container->get('liip_imagine.filter.manager'); // the filter manager service
 
            $filter = 'my_thumb' ; // find the image and determine its type
            $image = $dataManager->find($filter, $dir);
 
            $response = $filterManager->get($this->getRequest(), $filter, $image, $dir); // run the filter 
            $thumb = $response->getContent();                               // get the image from the response
 
            $f = fopen($tpath, 'w');                                        // create thumbnail file
            fwrite($f, $thumb);                                             // write the thumbnail
            fclose($f);
J'ai cette erreur
Source image was searched with 'C:\wamp\www\gallery3\src\Gallery\BackBundle\Entity/../../../../web/uploads/img' out side of the defined root path
qui semble venir de cette ligne :
$image = $dataManager->find($filter, $dir);


gallery3\web\uploads\img

( et si je met pas de filtre tous fonctionne nickel avec ce chemin)


dans config.yml j'ai définis mon filtre my_thumb avec ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
    my_thumb:
            data_loader: default

Pourtant ça me semble correct de mettre les images dans ce dossier.
Je ne vois vraiment pas l'erreur ou alors il y a un problème de configuration ?

Merci pour vos réponses, je n'ai trouvé solution ailleurs

Pi