skipStandardProcessing skips standard image processing and returns the original image data. SVG images may be sanitized if configured to do so.
( img *vips.Image, imgdata imagedata.ImageData, po ProcessingOptions, )
| 251 | // |
| 252 | // SVG images may be sanitized if configured to do so. |
| 253 | func (p *Processor) skipStandardProcessing( |
| 254 | img *vips.Image, |
| 255 | imgdata imagedata.ImageData, |
| 256 | po ProcessingOptions, |
| 257 | ) (*Result, error) { |
| 258 | // Even if we skip standard processing, we still need to check image dimensions |
| 259 | // to not send an image bomb to the client |
| 260 | originWidth, originHeight, err := p.checkImageSize(img, imgdata.Format(), po) |
| 261 | if err != nil { |
| 262 | return nil, err |
| 263 | } |
| 264 | |
| 265 | imgdata, err = p.svg.Process(po.Options, imgdata) |
| 266 | if err != nil { |
| 267 | return nil, err |
| 268 | } |
| 269 | |
| 270 | // Return the original image |
| 271 | return &Result{ |
| 272 | OutData: imgdata, |
| 273 | OriginWidth: originWidth, |
| 274 | OriginHeight: originHeight, |
| 275 | ResultWidth: originWidth, |
| 276 | ResultHeight: originHeight, |
| 277 | }, nil |
| 278 | } |
| 279 | |
| 280 | // determineOutputFormat determines the output image format based on the processing options |
| 281 | // and image properties. |
no test coverage detected