fix(api): appease image size lint
This commit is contained in:
parent
c45663761d
commit
ff6389a5ef
1 changed files with 3 additions and 1 deletions
|
|
@ -768,7 +768,9 @@ func (s *APIV1Service) acquireImageProcessingSlot(ctx context.Context) (func(),
|
||||||
func validateImagePixelCount(imageData []byte) error {
|
func validateImagePixelCount(imageData []byte) error {
|
||||||
config, _, err := image.DecodeConfig(bytes.NewReader(imageData))
|
config, _, err := image.DecodeConfig(bytes.NewReader(imageData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
// Some formats supported by imaging do not expose dimensions through
|
||||||
|
// the standard image registry. Let the full decoder handle those.
|
||||||
|
return nil //nolint:nilerr
|
||||||
}
|
}
|
||||||
if config.Width <= 0 || config.Height <= 0 {
|
if config.Width <= 0 || config.Height <= 0 {
|
||||||
return errors.New("invalid image dimensions")
|
return errors.New("invalid image dimensions")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue