filer: skip resizing image if width or height larger than original image

fix https://github.com/chrislusf/seaweedfs/issues/1239#issuecomment-602140779
This commit is contained in:
Chris Lu
2020-03-21 22:16:00 -07:00
parent 7c111f7b75
commit 6ff9e2835e
3 changed files with 56 additions and 13 deletions

View File

@@ -142,11 +142,11 @@ func NewChunkedFileReader(chunkList []*ChunkInfo, master string) *ChunkedFileRea
func (cf *ChunkedFileReader) Seek(offset int64, whence int) (int64, error) {
var err error
switch whence {
case 0:
case 1:
case io.SeekStart:
case io.SeekCurrent:
offset += cf.pos
case 2:
offset = cf.totalSize - offset
case io.SeekEnd:
offset = cf.totalSize + offset
}
if offset > cf.totalSize {
err = ErrInvalidRange