BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Images are missing when I move to a new server
#17 opened by Paul Bell
Description
Solution:
Delete all files in system/user/cache/ansel_persistent
and make sure this directory is ignored for version control and deployments.
I'm moving a site from dev server to live (the environments are identical) using my usual workflow - deploy the repository and copy over the database, then upload any assets that aren't in version control via FTP.
I've checked that all the images are there (and they're all showing up in the file manager now). The problem is with images that are using the "resize" functionality within the template. This doesn't seem to be working.
Here's my tag: {img:url:resize height="250" width="800" crop="true"}
This displays fine on the dev site, but on the live site, it comes up with a broken image. I guess the system thinks it's already made this image and so doesn't need to make it again? Or something else is going on... The made images have different filenames on dev and on live.
If I tweak the height or width by a pixel, the system will create me a nice new image on the live site, but then my image sizes will be off. Is there a way to force the system to remake these images?
I've tried selecting the images again in the blog post/event in EE, but that didn't seem to work (perhaps it would have if I'd selected a slightly different crop...
Replies
- Paul Bell
Replied 4/24/2017 9:10 AM, Edited 3/12/2018 6:41 PM
Update - I've updated to latest version of Ansel (2.0.3), latest EE (3.5.6), and PHP 7.1. Still same issue.
- Paul Bell
Replied 4/24/2017 9:27 AM, Edited 3/12/2018 6:41 PM
One more update - I was able to get Ansel to remake the images by specifying a different quality - quality="79" rather than the default. It works and I'm now able to launch, but I guess it can be fixed more neatly?
- TJ Draper
Replied 4/24/2017 10:28 AM, Edited 3/12/2018 6:41 PM
Ansel stores a text file in
system/user/cache/ansel_persistent
for each on-the-fly manipulation so it knows whether a manipulation has been created and what time it was created. As with anything in the cache directory, this directory should be ignored for the purposes of git/deployments. In order to get Ansel to re-create the on-the-fly manipulation in a new environment, make sure that all the files in theansel_persistent
directory are deleted and that should get you all fixed up. - Paul Bell
Replied 4/25/2017 10:57 AM, Edited 3/12/2018 6:41 PM
Thanks - I've done that, so hopefully that's resolved the issue.
- Dovla
Replied 3/11/2018 6:58 PM, Edited 3/12/2018 6:41 PM
I have this issue even though I've done what the solution says...everything works fine on the local server but my dev environment won't recreate any images. They all show up fine inside the admin and all the file paths are correct. If I upload a new image or crop an existing one then it will get regenerated but anything that was previously uploaded doesn't work
- TJ Draper
Replied 3/12/2018 9:27 AM, Edited 3/12/2018 6:41 PM
Hi Dovla,
If the
ansel_persistent
directory is cleared out, Ansel will be forced to regenerate "on-the-fly" resizes in templates asansel_persistent
is the only place Ansel checks for resizing cache. If The resizes are not taking place in your new environment there are 2 possibilities:- There is template or static caching going on and the Ansel tag doesn't get a chance to run again after you cleared out the
ansel_persistent
directory. - The original images for the field's upload directory are present, but the images for the save directory are not present. When transitioning from one server to another, all images in a field's chosen save directory must also be uploaded.
If you're still having issues can you open a new issue as this one is older and has been marked complete for some time.
- There is template or static caching going on and the Ansel tag doesn't get a chance to run again after you cleared out the
- Dovla
Replied 3/12/2018 6:41 PM
it was the second issue....I forgot to upload the save directory images because I thought they would also be resized on the fly which obviously isn't the case...I uploaded all of them and everything is fine :)