Skip to content

Commit

Permalink
disable thumbnail for animation
Browse files Browse the repository at this point in the history
  • Loading branch information
cshum committed Sep 27, 2022
1 parent 69257eb commit 54a1287
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vips/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (v *Processor) NewThumbnail(
}
if crop == InterestingNone || size == SizeForce {
if img, err = v.CheckResolution(
newThumbnailFromBlob(ctx, blob, width, height, crop, size, params),
v.newThumbnailFallback(ctx, blob, width, height, crop, size, params),
); err != nil {
return nil, WrapErr(err)
}
Expand Down Expand Up @@ -211,16 +211,16 @@ func (v *Processor) NewThumbnail(
// only allow real thumbnail for jpeg gif webp
img, err = newThumbnailFromBlob(ctx, blob, width, height, crop, size, nil)
default:
img, err = v.newThumbnailFallback(ctx, blob, width, height, crop, size)
img, err = v.newThumbnailFallback(ctx, blob, width, height, crop, size, nil)
}
}
return v.CheckResolution(img, WrapErr(err))
}

func (v *Processor) newThumbnailFallback(
ctx context.Context, blob *imagor.Blob, width, height int, crop Interesting, size Size,
ctx context.Context, blob *imagor.Blob, width, height int, crop Interesting, size Size, params *ImportParams,
) (img *Image, err error) {
if img, err = v.CheckResolution(newImageFromBlob(ctx, blob, nil)); err != nil {
if img, err = v.CheckResolution(newImageFromBlob(ctx, blob, params)); err != nil {
return
}
if err = img.ThumbnailWithSize(width, height, crop, size); err != nil {
Expand Down

0 comments on commit 54a1287

Please sign in to comment.