Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Image thumbnails being cleared after updating

Started by Nick 5 years ago · 5 replies · 546 views
5 years ago

Hello! I recently started using Grav for my personal website and I love it so far, with the exception of one really irritating issue: I have multiple image gallery pages, some with over 100 images, using cropZoom to make thumbnails. Every time I update Grav or otherwise have to clear the cache, all of those thumbnails are wiped along with it, which means next time those pages are loaded it takes a really long time cropping all the images again.

Apologies if this is a bit of a dumb question, but is there any way I can set up Grav to put the thumbnail images in a folder that won't get wiped after every update? Or set it to not touch the images folder at all?

5 years ago

@Nicede, When performing a search on either Google or here on Discourse using 'grav clear cache images' you'll find the following existing post Images deleted after Clear Cache.

The post points to the Cache configuration section of the documentation:

clear_images_by_default: By default grav will include processed images when cache clears, this can be disabled by setting this to false

What setting is your installation using?

Note, the default behaviour has been changed from true to false in release 1.7.16. The docs however, have not been updated yet... I've created a PR to fix this.

last edited 08/01/21 by pamtbaau
5 years ago

@pamtbaau, I looked at my /config/system.yaml and this setting appears to be set to false.

5 years ago

With clear_images_by_default: false, in my fresh Grav 1.7.18 install, the '/images' folder is not being cleared when using $ bin/grav cache...

Steps:

  • Copy image to '/user/pages/02.typography/'
  • Add ![image](image.jpg?cropzoom=100,100) to '/user/pages/02.typography/default.md'
  • Browse to typography page
  • File '/path/to/...b3735e2f843ff128e6f32ad-image.jpg' is being created.
  • Run $ bin/grav cache
  • File '/path/to/...b3735e2f843ff128e6f32ad-image.jpg' still exists
  • Set value cache:clear_images_by_default:true in '/user/config/system.yaml'
  • Run $ bin/grav cache
  • File '/path/to/...b3735e2f843ff128e6f32ad-image.jpg' has been cleared

Unfortunately, cache:clear_images_by_default:false does not preserve the '/images' folder when running $ bin/gpm selfupdate.

If this is too much of an issue for you, you might might consider creating an issue on github.

5 years ago

My issue is that it out the images folder after updating Grav through the Admin Panel. I may just end up creating an issue through Github.

5 years ago

@Nicede, There is IMHO no difference between upgrading from Admin or the command prompt. Both use '/system/src/Grav/Common/GPM/Installer.php::install()'

So, if you do create an issue, I would use the Grav repo as mentioned above.

Suggested topics

Topic Participants Replies Views Activity
Support · by Duc , 12 hours ago
1 34 12 hours ago
Support · by Thomas, 1 week ago
3 111 21 hours ago
Support · by Anna, 4 days ago
2 101 2 days ago
Support · by Justin Young, 2 days ago
1 70 2 days ago
Support · by Duc , 1 week ago
2 106 6 days ago