MCPcopy
hub / github.com/h2non/bimg / Process

Method Process

image.go:202–209  ·  view source on GitHub ↗

Process processes the image based on the given transformation options, talking with libvips bindings accordingly and returning the resultant image buffer.

(o Options)

Source from the content-addressed store, hash-verified

200// talking with libvips bindings accordingly and returning the resultant
201// image buffer.
202func (i *Image) Process(o Options) ([]byte, error) {
203 image, err := Resize(i.buffer, o)
204 if err != nil {
205 return nil, err
206 }
207 i.buffer = image
208 return image, nil
209}
210
211// Metadata returns the image metadata (size, alpha channel, profile, EXIF rotation).
212func (i *Image) Metadata() (ImageMetadata, error) {

Callers 15

ResizeMethod · 0.95
ForceResizeMethod · 0.95
ResizeAndCropMethod · 0.95
SmartCropMethod · 0.95
ExtractMethod · 0.95
EnlargeMethod · 0.95
EnlargeAndCropMethod · 0.95
CropMethod · 0.95
CropByWidthMethod · 0.95
CropByHeightMethod · 0.95
ThumbnailMethod · 0.95
WatermarkMethod · 0.95

Calls 1

ResizeFunction · 0.70

Tested by 5

TestImageGifToJpegFunction · 0.64
TestImagePdfToJpegFunction · 0.64
TestImageSvgToJpegFunction · 0.64
TestImageTrimParametersFunction · 0.64