Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix(api): appease image size lint

boojackff6389a5ef73
diff --git a/server/router/api/v1/attachment_service.go b/server/router/api/v1/attachment_service.go
index 2dc89b6fe..b2f874cf1 100644
--- a/server/router/api/v1/attachment_service.go
+++ b/server/router/api/v1/attachment_service.go
@@ -768,7 +768,9 @@ func (s *APIV1Service) acquireImageProcessingSlot(ctx context.Context) (func(),
func validateImagePixelCount(imageData []byte) error {
config, _, err := image.DecodeConfig(bytes.NewReader(imageData))
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 {
return errors.New("invalid image dimensions")