From 08521dac8323403933a8fd11acfd16930af5f17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Feb 2018 09:01:47 +0100 Subject: hugolib: Improve error message in .Render --- hugolib/page_output.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugolib/page_output.go b/hugolib/page_output.go index 9844b150a..0a51e72f7 100644 --- a/hugolib/page_output.go +++ b/hugolib/page_output.go @@ -130,7 +130,7 @@ func (p *PageOutput) Render(layout ...string) template.HTML { if templ != nil { res, err := templ.ExecuteToString(p) if err != nil { - helpers.DistinctErrorLog.Printf("in .Render: Failed to execute template %q for page %q", layout, p.pathOrTitle()) + helpers.DistinctErrorLog.Printf("in .Render: Failed to execute template %q: %s", layout, err) return template.HTML("") } return template.HTML(res) -- cgit v1.2.3 From 2851af0225cdf6c4e47058979cd22949ed6d1fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Feb 2018 09:14:44 +0100 Subject: resource: Improve error processing error message --- resource/image.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resource/image.go b/resource/image.go index c9ee90bf1..1914b3c04 100644 --- a/resource/image.go +++ b/resource/image.go @@ -223,11 +223,14 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c return i.spec.imageCache.getOrCreate(i, key, func(resourceCacheFilename string) (*Image, error) { ci := i.clone() + errOp := action + errPath := i.AbsSourceFilename() + ci.setBasePath(conf) src, err := i.decodeSource() if err != nil { - return nil, err + return nil, &os.PathError{Op: errOp, Path: errPath, Err: err} } if conf.Rotate != 0 { @@ -237,7 +240,7 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c converted, err := f(src, conf) if err != nil { - return ci, err + return ci, &os.PathError{Op: errOp, Path: errPath, Err: err} } b := converted.Bounds() -- cgit v1.2.3 From d8fdffb55268464d54558d6f9cd3874b612dc7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Feb 2018 21:45:51 +0100 Subject: resource: Fix multi-threaded image processing issue When doing something like this with the same image from a partial used in, say, both the home page and the single page: ```bash {{ with $img }} {{ $big := .Fill "1024x512 top" }} {{ $small := $big.Resize "512x" }} {{ end }} ``` There would be timing issues making Hugo in some cases try to process the same image with the same instructions in parallel. You would experience errors of type: ```bash png: invalid format: not enough pixel data ``` This commit works around that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. The current workaround before this fix is to always operate on the original: ```bash {{ with $img }} {{ $big := .Fill "1024x512 top" }} {{ $small := .Fill "512x256 top" }} {{ end }} ``` Fixes #4404 --- resource/image.go | 3 ++ resource/image_cache.go | 8 +++++- resource/image_test.go | 68 ++++++++++++++++++++++++++++++++++++++++++++ resource/testhelpers_test.go | 46 +++++++++++++++++++++++++++--- 4 files changed, 120 insertions(+), 5 deletions(-) diff --git a/resource/image.go b/resource/image.go index 1914b3c04..208a0e9fb 100644 --- a/resource/image.go +++ b/resource/image.go @@ -112,6 +112,9 @@ type Image struct { copyToDestinationInit sync.Once + // Lock used when creating alternate versions of this image. + createMu sync.Mutex + imaging *Imaging hash string diff --git a/resource/image_cache.go b/resource/image_cache.go index 5720fb623..250155db1 100644 --- a/resource/image_cache.go +++ b/resource/image_cache.go @@ -28,7 +28,8 @@ type imageCache struct { absCacheDir string pathSpec *helpers.PathSpec mu sync.RWMutex - store map[string]*Image + + store map[string]*Image } func (c *imageCache) isInCache(key string) bool { @@ -69,6 +70,11 @@ func (c *imageCache) getOrCreate( } // Now look in the file cache. + // Multiple Go routines can invoke same operation on the same image, so + // we need to make sure this is serialized per source image. + parent.createMu.Lock() + defer parent.createMu.Unlock() + cacheFilename := filepath.Join(c.absCacheDir, key) // The definition of this counter is not that we have processed that amount diff --git a/resource/image_test.go b/resource/image_test.go index de706b0ac..e981a208f 100644 --- a/resource/image_test.go +++ b/resource/image_test.go @@ -15,8 +15,12 @@ package resource import ( "fmt" + "math/rand" + "strconv" "testing" + "sync" + "github.com/stretchr/testify/require" ) @@ -141,6 +145,51 @@ func TestImageTransformLongFilename(t *testing.T) { assert.Equal("/a/_hu59e56ffff1bc1d8d122b1403d34e039f_90587_c876768085288f41211f768147ba2647.jpg", resized.RelPermalink()) } +func TestImageTransformConcurrent(t *testing.T) { + + var wg sync.WaitGroup + + assert := require.New(t) + + spec := newTestResourceOsFs(assert) + + image := fetchImageForSpec(spec, assert, "sunset.jpg") + + for i := 0; i < 4; i++ { + wg.Add(1) + go func(id int) { + defer wg.Done() + for j := 0; j < 5; j++ { + img := image + for k := 0; k < 2; k++ { + r1, err := img.Resize(fmt.Sprintf("%dx", id-k)) + if err != nil { + t.Fatal(err) + } + + if r1.Width() != id-k { + t.Fatalf("Width: %d:%d", r1.Width(), j) + } + + r2, err := r1.Resize(fmt.Sprintf("%dx", id-k-1)) + if err != nil { + t.Fatal(err) + } + + _, err = r2.decodeSource() + if err != nil { + t.Fatal("Err decode:", err) + } + + img = r1 + } + } + }(i + 20) + } + + wg.Wait() +} + func TestDecodeImaging(t *testing.T) { assert := require.New(t) m := map[string]interface{}{ @@ -208,3 +257,22 @@ func TestImageWithMetadata(t *testing.T) { assert.Equal("Sunset #1", resized.Name()) } + +func BenchmarkResizeParallel(b *testing.B) { + assert := require.New(b) + img := fetchSunset(assert) + + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + w := rand.Intn(10) + 10 + resized, err := img.Resize(strconv.Itoa(w) + "x") + if err != nil { + b.Fatal(err) + } + _, err = resized.Resize(strconv.Itoa(w-1) + "x") + if err != nil { + b.Fatal(err) + } + } + }) +} diff --git a/resource/testhelpers_test.go b/resource/testhelpers_test.go index 2b543ab64..7f6d4f307 100644 --- a/resource/testhelpers_test.go +++ b/resource/testhelpers_test.go @@ -6,8 +6,11 @@ import ( "image" "io" + "io/ioutil" "os" "path" + "runtime" + "strings" "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/hugofs" @@ -45,17 +48,53 @@ func newTestResourceSpecForBaseURL(assert *require.Assertions, baseURL string) * return spec } +func newTestResourceOsFs(assert *require.Assertions) *Spec { + cfg := viper.New() + cfg.Set("baseURL", "https://example.com") + + workDir, err := ioutil.TempDir("", "hugores") + + if runtime.GOOS == "darwin" && !strings.HasPrefix(workDir, "/private") { + // To get the entry folder in line with the rest. This its a little bit + // mysterious, but so be it. + workDir = "/private" + workDir + } + + contentDir := "base" + cfg.Set("workingDir", workDir) + cfg.Set("contentDir", contentDir) + cfg.Set("resourceDir", filepath.Join(workDir, "res")) + + fs := hugofs.NewFrom(hugofs.Os, cfg) + fs.Destination = &afero.MemMapFs{} + + s, err := helpers.NewPathSpec(fs, cfg) + + assert.NoError(err) + + spec, err := NewSpec(s, media.DefaultTypes) + assert.NoError(err) + return spec + +} + func fetchSunset(assert *require.Assertions) *Image { return fetchImage(assert, "sunset.jpg") } func fetchImage(assert *require.Assertions, name string) *Image { + spec := newTestResourceSpec(assert) + return fetchImageForSpec(spec, assert, name) +} + +func fetchImageForSpec(spec *Spec, assert *require.Assertions, name string) *Image { src, err := os.Open("testdata/" + name) assert.NoError(err) - spec := newTestResourceSpec(assert) + workingDir := spec.Cfg.GetString("workingDir") + f := filepath.Join(workingDir, name) - out, err := spec.Fs.Source.Create("/b/" + name) + out, err := spec.Fs.Source.Create(f) assert.NoError(err) _, err = io.Copy(out, src) out.Close() @@ -66,11 +105,10 @@ func fetchImage(assert *require.Assertions, name string) *Image { return path.Join("/a", s) } - r, err := spec.NewResourceFromFilename(factory, "/public", "/b/"+name, name) + r, err := spec.NewResourceFromFilename(factory, "/public", f, name) assert.NoError(err) assert.IsType(&Image{}, r) return r.(*Image) - } func assertFileCache(assert *require.Assertions, fs *hugofs.Fs, filename string, width, height int) { -- cgit v1.2.3 From fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 7 Feb 2018 21:45:53 +0100 Subject: Bump Travis/Snapcraft to Go 1.9.4 --- .travis.yml | 4 ++-- snapcraft.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f61cfbc87..3e94894fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: go sudo: required dist: precise go: - - 1.8.6 - - 1.9.3 + - 1.8.7 + - 1.9.4 - tip os: - linux diff --git a/snapcraft.yaml b/snapcraft.yaml index 0f2cf0819..240a4dbf2 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -36,4 +36,4 @@ parts: strip --remove-section=.comment --remove-section=.note $SNAPCRAFT_PART_INSTALL/bin/hugo after: [go] go: - source-tag: go1.9.3 + source-tag: go1.9.4 -- cgit v1.2.3 From 53e661e7c9f4b0e1c2c82273c605a8a6e46f517b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 8 Feb 2018 19:25:02 +0100 Subject: releaser: Update to Go 1.9.4 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc4fc6005..999fafd17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ defaults: &defaults working_directory: /go/src/github.com/gohugoio docker: - - image: bepsays/ci-goreleaser:0.34.2-7 + - image: bepsays/ci-goreleaser:0.34.2-8 version: 2 jobs: -- cgit v1.2.3 From d7bf9d4daa4d40e0ece3213824507cd7ddb031ec Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 08:51:22 +0000 Subject: releaser: Add release notes draft for 0.36.1 Rename to *-ready.md to continue. [ci skip] --- temp/0.36.1-relnotes.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 temp/0.36.1-relnotes.md diff --git a/temp/0.36.1-relnotes.md b/temp/0.36.1-relnotes.md new file mode 100644 index 000000000..94f3be0e0 --- /dev/null +++ b/temp/0.36.1-relnotes.md @@ -0,0 +1,32 @@ + + +This is a bug-fix release with a couple of important fixes. + + +Hugo now has: + +* 23397+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 448+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 197+ [themes](http://themes.gohugo.io/) + +## Enhancements + +### Core + +* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) + +### Other + +* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) +* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) + +## Fixes + +### Other + +* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) + + + + + -- cgit v1.2.3 From a1f40084f9dfdd45698dc139c7c481da29fb0b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 15 Feb 2018 10:03:24 +0100 Subject: Release 0.36.1 --- temp/0.36.1-relnotes-ready.md | 33 +++++++++++++++++++++++++++++++++ temp/0.36.1-relnotes.md | 32 -------------------------------- 2 files changed, 33 insertions(+), 32 deletions(-) create mode 100644 temp/0.36.1-relnotes-ready.md delete mode 100644 temp/0.36.1-relnotes.md diff --git a/temp/0.36.1-relnotes-ready.md b/temp/0.36.1-relnotes-ready.md new file mode 100644 index 000000000..f4d4fd86f --- /dev/null +++ b/temp/0.36.1-relnotes-ready.md @@ -0,0 +1,33 @@ +This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := $big.Resize "512x" }} +{{ end }} +``` + +There would be timing issues making Hugo in some cases trying to process the same image twice at the same time. + +You would experience errors of type: + +```bash +png: invalid format: not enough pixel data +``` + +This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. + +The current workaround before this fix is to always operate on the original: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := .Fill "512x256 top" }} +{{ end }} +``` +This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user. + +* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) +* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) +* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) +* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) diff --git a/temp/0.36.1-relnotes.md b/temp/0.36.1-relnotes.md deleted file mode 100644 index 94f3be0e0..000000000 --- a/temp/0.36.1-relnotes.md +++ /dev/null @@ -1,32 +0,0 @@ - - -This is a bug-fix release with a couple of important fixes. - - -Hugo now has: - -* 23397+ [stars](https://github.com/gohugoio/hugo/stargazers) -* 448+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) -* 197+ [themes](http://themes.gohugo.io/) - -## Enhancements - -### Core - -* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) - -### Other - -* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) -* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) - -## Fixes - -### Other - -* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) - - - - - -- cgit v1.2.3 From 19228ed83c55e5c772d661c4cc2cf0194bdd0794 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:07:43 +0000 Subject: releaser: Bump versions for release of 0.36.1 [ci skip] --- commands/new.go | 2 +- docs/config.toml | 2 +- helpers/hugo.go | 2 +- snapcraft.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/new.go b/commands/new.go index e6cc7981c..9b02084d7 100644 --- a/commands/new.go +++ b/commands/new.go @@ -344,7 +344,7 @@ description = "" homepage = "http://example.com/" tags = [] features = [] -min_version = "0.36" +min_version = "0.36.1" [author] name = "" diff --git a/docs/config.toml b/docs/config.toml index db8650a71..0147f8df8 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -71,7 +71,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.36" + release = "0.36.1" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/helpers/hugo.go b/helpers/hugo.go index 18815538c..dea9cc2ff 100644 --- a/helpers/hugo.go +++ b/helpers/hugo.go @@ -94,7 +94,7 @@ func (v HugoVersion) NextPatchLevel(level int) HugoVersion { // This should be the only one. var CurrentHugoVersion = HugoVersion{ Number: 0.36, - PatchLevel: 0, + PatchLevel: 1, Suffix: "", } diff --git a/snapcraft.yaml b/snapcraft.yaml index 240a4dbf2..7d0a3878b 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,5 +1,5 @@ name: hugo -version: "0.36" +version: "0.36.1" summary: Fast and Flexible Static Site Generator description: | Hugo is a static HTML and CSS website generator written in Go. It is -- cgit v1.2.3 From 25e88ccabe9b04c42ffb43528c86743f623fac46 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:07:43 +0000 Subject: releaser: Add release notes to /docs for release of 0.36.1 [ci skip] --- docs/content/news/0.36.1-relnotes-ready.md | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/content/news/0.36.1-relnotes-ready.md diff --git a/docs/content/news/0.36.1-relnotes-ready.md b/docs/content/news/0.36.1-relnotes-ready.md new file mode 100644 index 000000000..68063489f --- /dev/null +++ b/docs/content/news/0.36.1-relnotes-ready.md @@ -0,0 +1,45 @@ + +--- +date: 2018-02-15 +title: "0.36.1" +description: "0.36.1" +slug: "0.36.1" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := $big.Resize "512x" }} +{{ end }} +``` + +There would be timing issues making Hugo in some cases trying to process the same image twice at the same time. + +You would experience errors of type: + +```bash +png: invalid format: not enough pixel data +``` + +This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. + +The current workaround before this fix is to always operate on the original: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := .Fill "512x256 top" }} +{{ end }} +``` +This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user. + +* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) +* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) +* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) +* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) -- cgit v1.2.3 From 8de91da74fbef277bd314f38575ac055a54a443d Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:10:09 +0000 Subject: releaser: Prepare repository for 0.37-DEV [ci skip] --- commands/new.go | 2 +- docs/config.toml | 2 +- helpers/hugo.go | 6 +++--- snapcraft.yaml | 4 ++-- temp/0.36.1-relnotes-ready.md | 33 --------------------------------- 5 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 temp/0.36.1-relnotes-ready.md diff --git a/commands/new.go b/commands/new.go index 9b02084d7..e6cc7981c 100644 --- a/commands/new.go +++ b/commands/new.go @@ -344,7 +344,7 @@ description = "" homepage = "http://example.com/" tags = [] features = [] -min_version = "0.36.1" +min_version = "0.36" [author] name = "" diff --git a/docs/config.toml b/docs/config.toml index 0147f8df8..53e4e9afa 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -71,7 +71,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.36.1" + release = "0.37-DEV" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/helpers/hugo.go b/helpers/hugo.go index dea9cc2ff..c4c3f4a76 100644 --- a/helpers/hugo.go +++ b/helpers/hugo.go @@ -93,9 +93,9 @@ func (v HugoVersion) NextPatchLevel(level int) HugoVersion { // CurrentHugoVersion represents the current build version. // This should be the only one. var CurrentHugoVersion = HugoVersion{ - Number: 0.36, - PatchLevel: 1, - Suffix: "", + Number: 0.37, + PatchLevel: 0, + Suffix: "-DEV", } func hugoVersion(version float32, patchVersion int, suffix string) string { diff --git a/snapcraft.yaml b/snapcraft.yaml index 7d0a3878b..8a77485fb 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,12 +1,12 @@ name: hugo -version: "0.36.1" +version: "0.37-DEV" summary: Fast and Flexible Static Site Generator description: | Hugo is a static HTML and CSS website generator written in Go. It is optimized for speed, easy use and configurability. Hugo takes a directory with content and templates and renders them into a full HTML website. confinement: strict -grade: stable # "devel" or "stable" +grade: devel # "devel" or "stable" apps: hugo: diff --git a/temp/0.36.1-relnotes-ready.md b/temp/0.36.1-relnotes-ready.md deleted file mode 100644 index f4d4fd86f..000000000 --- a/temp/0.36.1-relnotes-ready.md +++ /dev/null @@ -1,33 +0,0 @@ -This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page: - -```bash -{{ with $img }} -{{ $big := .Fill "1024x512 top" }} -{{ $small := $big.Resize "512x" }} -{{ end }} -``` - -There would be timing issues making Hugo in some cases trying to process the same image twice at the same time. - -You would experience errors of type: - -```bash -png: invalid format: not enough pixel data -``` - -This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. - -The current workaround before this fix is to always operate on the original: - -```bash -{{ with $img }} -{{ $big := .Fill "1024x512 top" }} -{{ $small := .Fill "512x256 top" }} -{{ end }} -``` -This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user. - -* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) -* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) -* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) -* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) -- cgit v1.2.3