Skip to content

Commit

Permalink
images: Fix cache busting of image text filter
Browse files Browse the repository at this point in the history
See #9238
  • Loading branch information
bep committed Dec 7, 2021
1 parent 6c3bc5e commit e61cdf3
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func TestImageOperationsGolden(t *testing.T) {
f.Overlay(gopher.(images.ImageSource), 20, 30),
f.Text("No options"),
f.Text("This long text is to test line breaks. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."),
f.Text("Hugo rocks!", map[string]interface{}{"x": 30, "y": 30, "size": 15, "color": "#ff0000"}),
f.Text("Hugo rocks!", map[string]interface{}{"x": 3, "y": 3, "size": 20, "color": "#fc03b1"}),
}

resized, err := orig.Fill("400x200 center")
Expand Down
5 changes: 2 additions & 3 deletions resources/images/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func (*Filters) Text(text string, options ...interface{}) gift.Filter {
linespacing: 2,
}

var opt map[string]interface{}
var opt maps.Params
if len(options) > 0 {
opt := maps.MustToParamsAndPrepare(options[0])
opt = maps.MustToParamsAndPrepare(options[0])
for option, v := range opt {
switch option {
case "color":
Expand All @@ -62,7 +62,6 @@ func (*Filters) Text(text string, options ...interface{}) gift.Filter {
case "linespacing":
tf.linespacing = cast.ToInt(v)
}

}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e61cdf3

Please sign in to comment.