MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / shouldSkipStandardProcessing

Method shouldSkipStandardProcessing

processing/processing.go:225–248  ·  view source on GitHub ↗

Returns true if image should not be processed as usual

(
	inFormat imagetype.Type,
	po ProcessingOptions,
)

Source from the content-addressed store, hash-verified

223
224// Returns true if image should not be processed as usual
225func (p *Processor) shouldSkipStandardProcessing(
226 inFormat imagetype.Type,
227 po ProcessingOptions,
228) bool {
229 outFormat := po.Format()
230 skipProcessingFormatEnabled := po.ShouldSkipFormatProcessing(inFormat)
231
232 if inFormat == imagetype.SVG {
233 isOutUnknown := outFormat == imagetype.Unknown
234
235 switch {
236 case outFormat == imagetype.SVG:
237 return true
238 case isOutUnknown && !p.config.AlwaysRasterizeSvg:
239 return true
240 case isOutUnknown && p.config.AlwaysRasterizeSvg && skipProcessingFormatEnabled:
241 return true
242 default:
243 return false
244 }
245 } else {
246 return skipProcessingFormatEnabled && (inFormat == outFormat || outFormat == imagetype.Unknown)
247 }
248}
249
250// skipStandardProcessing skips standard image processing and returns the original image data.
251//

Callers 1

ProcessImageMethod · 0.95

Calls 2

FormatMethod · 0.65

Tested by

no test coverage detected