liip / liip/LiipImagineBundle

How is possible use LiiImagineBundle for private image files

Open
#1,503 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.7k
Forks
386
Avg merge
1d 10h
Merged PRs (30d)
3

Description

In my Symfony application, user can upload images but images are stored in non public directory, in my case I store this in /var/card-upload. For display images in templateI use this controller method with
```
fileServe($card->getImage());
}
/**
* Returns a private file for display.
*
* @param string $path
* @return BinaryFileResponse
*/
private function fileServe(string $path): BinaryFileResponse
{
$absolutePath = $this->getParameter('card_directory') . '/' . $path;

return new BinaryFileResponse($absolutePath);
}
}
```
Now I dont how I can this BinaryFileResponse filter by using LiipImagineBundle. It is posiible?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ServePrivateImageController and its privateImageServe method, then review how BinaryFileResponse serves files from /var/card-upload. Determine how LiipImagineBundle should transform a private image while preserving access control, and consider the request complete when the transformed image can be displayed from the private directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.