mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2026-01-12 08:30:45 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a63d2395f0 |
@@ -17,6 +17,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const webpMaxHeight = 16383
|
||||||
|
|
||||||
type Converter struct {
|
type Converter struct {
|
||||||
maxHeight int
|
maxHeight int
|
||||||
cropHeight int
|
cropHeight int
|
||||||
@@ -202,6 +204,9 @@ func (converter *Converter) checkPageNeedsSplit(page *manga.Page) (bool, image.I
|
|||||||
bounds := img.Bounds()
|
bounds := img.Bounds()
|
||||||
height := bounds.Dy()
|
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
|
return height >= converter.maxHeight, img, format, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user