Skip to content

Commit

Permalink
change image size limits
Browse files Browse the repository at this point in the history
  • Loading branch information
quackduck committed Sep 17, 2023
1 parent 0286562 commit 3d5c481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func replaceImgs(md string, width int, cache map[string]image.Image) string {
// https://github.com/golang/go/issues/12512#issuecomment-137981217
header := new(bytes.Buffer)
config, _, err := image.DecodeConfig(io.TeeReader(limitReader, header))
if err != nil || config.Width > 4032 || config.Height > 3024 {
if err != nil || config.Width > 4032*2 || config.Height > 3024*2 {
return replaceImgs(md[:start]+imgText+" (invalid or too large to render)"+md[end+6:], width, cache)
}
img, _, err := image.Decode(io.MultiReader(header, limitReader))
Expand Down

0 comments on commit 3d5c481

Please sign in to comment.