-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom StreamLoader of LiipImagineBundle never instantiated #698
Comments
That's okay that resolve and store are not called at first time. They will be called when the filterAction is called. What is the url actually put into the template? How does it look like? |
The url returned is This is not what I am expecting... |
The bundle works correctly, if the image is not in the cache it generates the link to the filter action which will store the origin image to the cache |
The url I am expecting to have is: https://storage.googleapis.com/the-bucket/cache/the-filter/image-name.jpg The original image is in https://storage.googleapis.com/the-bucket/img/image-name.jpg Could you please just tell me why the custom data loader is never instantiated? |
Because you configured something wrong. Sorry I dont have enough time to look into details right now. |
Don't worry! |
If you have goods links I will be happy ;) |
Hi @mappedinn In my case I'm working with LiipImagine, VichUploader and KnpGaufrette using aws-s3 adapter. Files are correctly uploaded by VichUploader but seems LiipImagene can generate images dues a Did you found any solution? Thanks |
Here is the my solution, Thanks to @mappedinn , Config.yml
Service.yml
The Resolver
The Factory
|
@acanimal Yes its working, for read images you can set gaufrette liip_imagine: |
@girayk Is there any special configuration in the google cloud storage? Thank you very PS: can you fix the indentations? |
@mappedinn I updated my post with better indentations and i added google cloud storage factory example as well. I hope its will help. |
Thank you very much... I have to try it :) |
Hey, any luck @mappedinn? |
Hi, If it can help anyone here I paste a link with my experiences using LiipImagineBundle, VichUploaderBundle and Gaufrette on S3: http://www.acuriousanimal.com/2016/03/25/symfony-and-s3.html. Cheers |
Thanks guys! |
Hey @pdoreau , I don't know whether you ask specifically about a Gaufrette stream-wrapper, or GCS. If it's about the latter, we recently merged a flysystem resolver so that you can use the bundle with any given flysystem adapter. Incidentally I happened to write a flysystem adapter for gcs-you might want to have a look (https://github.com/cedricziel/flysystem-gcs). |
@cedricziel I was asking about a way to use GCS (both for data loader and cache) based on the source code posted in this issue. The method would be documented beside s3 and others. |
Flysystem is a generic way to abstract filesystems. Much like gaufrette. With a flysystem filesystem and an adapter registered as documented, you can use it, amongst other usages of course, as a way to load pictures and resolve caches with LiipImagineBundle. Yes. |
I would use Flysystem as cedricziel pointed out. Thus closing this issue. Please open a new issue if there are any further requests and thanks a lot! :) |
My images are stored in google cloud storage. It has been done through
VichUploaderBundle
andKnpGaufretteBunlde
with success. Below is how I configured them:Services
knp_gaufrette and vich_uploader config
Now, I need to read my images form the google cloud storage through
LiipImagineBundle
. Unfortunately, Google Cloud Storage is not supported byLiipImagineBundle
. So, I tried to implement a Google Cloud Storage Resolver in similar way as specified here: Custom cache resolver. Below is how I configured my resolver:The resolver is instantiated when ever there twig call for an image. It checks if the images is stored or not (the function
isStored($path)
is called and logger is telling that)! The functionresolve($path, $filter)
andstore(BinaryInterface $binary, $path, $filter)
are never called. Strange! I say this may be because the data loader is not working properly. So, I created a new data loader which is defined as follows:Guess what? The custom data loader is never instantiated! Have I missed some thing?
Thanks.
Resolver and Data loader
Here is my custom StreamLoader:
The text was updated successfully, but these errors were encountered: