"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "resources/image_cache.go" between
hugo-0.85.0.tar.gz and hugo-0.86.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

image_cache.go  (hugo-0.85.0):image_cache.go  (hugo-0.86.0)
skipping to change at line 75 skipping to change at line 75
func (c *imageCache) getOrCreate( func (c *imageCache) getOrCreate(
parent *imageResource, conf images.ImageConfig, parent *imageResource, conf images.ImageConfig,
createImage func() (*imageResource, image.Image, error)) (*resourceAdapte r, error) { createImage func() (*imageResource, image.Image, error)) (*resourceAdapte r, error) {
relTarget := parent.relTargetPathFromConfig(conf) relTarget := parent.relTargetPathFromConfig(conf)
memKey := parent.relTargetPathForRel(relTarget.path(), false, false, fals e) memKey := parent.relTargetPathForRel(relTarget.path(), false, false, fals e)
memKey = c.normalizeKey(memKey) memKey = c.normalizeKey(memKey)
// For the file cache we want to generate and store it once if possible. // For the file cache we want to generate and store it once if possible.
fileKeyPath := relTarget fileKeyPath := relTarget
if fi := parent.root.getFileInfo(); fi != nil { if fi := parent.root.getFileInfo(); fi != nil {
fileKeyPath.dir = filepath.ToSlash(filepath.Dir(fi.Meta().Path()) ) fileKeyPath.dir = filepath.ToSlash(filepath.Dir(fi.Meta().Path))
} }
fileKey := fileKeyPath.path() fileKey := fileKeyPath.path()
// First check the in-memory store, then the disk. // First check the in-memory store, then the disk.
c.mu.RLock() c.mu.RLock()
cachedImage, found := c.store[memKey] cachedImage, found := c.store[memKey]
c.mu.RUnlock() c.mu.RUnlock()
if found { if found {
return cachedImage, nil return cachedImage, nil
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)