MCPcopy Index your code
hub / github.com/cshum/imagor / newThumbnailFallback

Method newThumbnailFallback

processor/vipsprocessor/processor.go:398–411  ·  view source on GitHub ↗
(
	ctx context.Context, blob *imagor.Blob, width, height int, crop vips.Interesting, size vips.Size, options *vips.LoadOptions,
)

Source from the content-addressed store, hash-verified

396}
397
398func (v *Processor) newThumbnailFallback(
399 ctx context.Context, blob *imagor.Blob, width, height int, crop vips.Interesting, size vips.Size, options *vips.LoadOptions,
400) (img *vips.Image, err error) {
401 if img, err = v.CheckResolution(v.newImageFromBlob(ctx, blob, options)); err != nil {
402 return
403 }
404 if err = img.ThumbnailImage(width, &vips.ThumbnailImageOptions{
405 Height: height, Size: size, Crop: crop,
406 }); err != nil {
407 img.Close()
408 return
409 }
410 return img, WrapErr(err)
411}
412
413// NewImage creates new Image from imagor.Blob
414func (v *Processor) NewImage(ctx context.Context, blob *imagor.Blob, n, page int, dpi int) (*vips.Image, error) {

Callers 1

NewThumbnailMethod · 0.95

Implementers 4

cacherProcessorimagor_test.go
Processorprocessor/vipsprocessor/processor.go
testProcessorserver/server_test.go
slowTestProcessorserver/server_test.go

Calls 4

CheckResolutionMethod · 0.95
newImageFromBlobMethod · 0.95
WrapErrFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected