Documentation
¶
Overview ¶
Package imagedecode provides additive, bounded image barcode decoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLimitExceeded reports a caller-provided decode budget violation. ErrLimitExceeded = errors.New("imagedecode: limit exceeded") // ErrUnsupportedFormat reports a format absent from the image decoder. ErrUnsupportedFormat = errors.New("imagedecode: unsupported format") // ErrInvalidImage reports an image that cannot be converted for decoding. ErrInvalidImage = errors.New("imagedecode: invalid image") // ErrNotFound reports that no requested barcode was detected. ErrNotFound = errors.New("imagedecode: barcode not found") )
Functions ¶
func Decode ¶
Decode returns the first requested format found within the configured bounds. Decoded content is data only and is never executed or followed.
func DecodeEncoded ¶
func DecodeEncoded(ctx context.Context, input io.Reader, options Options) (barcode.DecodeResult, error)
DecodeEncoded bounds and decodes a PNG, JPEG, or GIF stream before scanning it for a barcode. The compressed byte and decoded image limits are enforced before the full image allocation.
Types ¶
type Limits ¶
type Limits struct {
MaxWidth int
MaxHeight int
MaxPixels int
MaxCandidates int
MaxPayloadBytes int
MaxRotations int
MaxMemoryBytes int
MaxEncodedBytes int
MaxCorrections int
MaxDuration time.Duration
}
Limits are enforced before image conversion and between decoder attempts. MaxRotations includes the original orientation and is limited to four.
Click to show internal directories.
Click to hide internal directories.