diff --git a/converter/webp/webp_converter.go b/converter/webp/webp_converter.go index 2fb64b2..f89c2cd 100644 --- a/converter/webp/webp_converter.go +++ b/converter/webp/webp_converter.go @@ -17,6 +17,8 @@ import ( "sync/atomic" ) +const webpMaxHeight = 16383 + type Converter struct { maxHeight int cropHeight int @@ -202,6 +204,9 @@ func (converter *Converter) checkPageNeedsSplit(page *manga.Page) (bool, image.I bounds := img.Bounds() height := bounds.Dy() + if height >= converter.maxHeight { + return false, img, format, fmt.Errorf("page[%d] height %d exceeds maximum height %d of webp format", page.Index, height, converter.maxHeight) + } return height >= converter.maxHeight, img, format, nil }