Skip to content
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

How to display default image if image does not exist on aws s3 ? #491

Open
vishalmelmatti opened this issue Sep 5, 2014 · 3 comments
Open
Labels
Level: New Feature 🆕 This item involves the introduction of new functionality. State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution.

Comments

@vishalmelmatti
Copy link

Hi,

I am using LiipImagineBundle with KnpGaufretteBundle, I can load images from aws s3 but if image does not exist it displays blank, I want to display my default image.

I couldn't find any configuration for this.

Can such configuration be made available in this bundle by any chance ? or is invalid feature request ?

Thanks.

@makasim
Copy link
Collaborator

makasim commented Sep 5, 2014

the feature request make sense IMO. Not sure about the right implementation. Should we hard code it in the config, of loader for example or pass it as a parameter of twig function?

@makasim makasim added this to the v1.1 milestone Sep 5, 2014
@vishalmelmatti
Copy link
Author

I tried to dig in to code, NotFound exception thrown by AWS S3 SDK getObject API is propogated till ImaginController:filter action but it is not handled in CacheManager:generateUrl . May be the call to
$this->router->generate
should be put in try cache and in case of exception we should call it again with

    $params = array(
        'path' => ltrim('%path_to_default_image%', '/'),
        'filter' => $filter
    );

or may be in ImagineController itself.

We should let path_to_default_image parameter be defined in config to be set by user.

@robfrawley robfrawley removed the Attn: Critical This issue or PR is critical and should be rushed into a new release ASAP. label Sep 27, 2016
@robfrawley robfrawley removed this from the v1.1-missed milestone Jan 25, 2017
@michellesanver michellesanver added the State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution. label Oct 4, 2019
@michellesanver
Copy link
Contributor

Still makes sense to do, need to investigate the right way to do it and write a more clear descriptive issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Level: New Feature 🆕 This item involves the introduction of new functionality. State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution.
Projects
None yet
Development

No branches or pull requests

4 participants