Returns true if image should not be processed as usual
( inFormat imagetype.Type, po ProcessingOptions, )
| 223 | |
| 224 | // Returns true if image should not be processed as usual |
| 225 | func (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 | // |
no test coverage detected