-
Notifications
You must be signed in to change notification settings - Fork 9
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
Disappearing Images #30
Comments
Brilliant. Any chance you'd be willing to submit that as a PR? |
Sure, but it may be better to add a better check here instead, I wrote an old S3 module for SS2.4 which checked the headers were 200 on S3 files before trying to use them, might be worth adding that in here too? Ah actually, it looks like you already check for missing remote image further down anyway, so probably fine as it is. Will create a PR now, can you grant me access? |
Another issue I saw was that when my app auto scales or I deploy, the cached images are of course lost, but the DB CloudImageCachedStore still tells SilverStripe they exist, so they aren't regenerated. I'm sure a quick check in the code for file_exists would fix this, but as a hack I just run a post deploy script on my app to do a flush=all And that clears the cache whenever I deploy to my site, or it autoscales. |
I'm not sure if anybody else has had this issue, but for me, as soon as my EC2 instance rebooted or scaled, images were lost.
I tracked it down to line 122 of CloudImage, the getFormattedImage function (Worth also adding to the doc that this ONLY works with that perhaps? E.G - CroppedImage etc all just fall back to standard Image.)
So that line seems to check if the file exists locally before doing anything else, which in most cases, it doesn't.
I changed that to
and now this works fine for me. As soon as I clear my assets folder on disk, it downloads every item again from S3, then resamples them and stores them correctly.
The text was updated successfully, but these errors were encountered: