From 644bcefd71339d58483f1a7c4a94ac7ff9c4dc75 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Fri, 29 Dec 2023 14:54:17 +0100 Subject: Resolve issues --- main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 9138754..95bb502 100644 --- a/main.go +++ b/main.go @@ -1638,9 +1638,7 @@ func syncRoot(c *syncContext, dbPath []string, fsPath string) error { FROM node AS n JOIN subtree AS s ON n.parent = s.id ) DELETE FROM node WHERE id IN ( SELECT id FROM subtree WHERE level <> 1 AND sha1 IS NULL - -- No idea why one can't put the "node" table in the subselect. - -- The whole query then matches nothing. - AND id NOT IN (SELECT parent FROM subtree) + AND id NOT IN (SELECT parent FROM node WHERE parent IS NOT NULL) )`) if err != nil { return err @@ -2283,7 +2281,7 @@ func (l *linearImage) At(x, y int) color.Color { // isWebPAnimation returns whether the given ReadSeeker starts a WebP animation. // See https://developers.google.com/speed/webp/docs/riff_container func isWebPAnimation(rs io.ReadSeeker) (bool, error) { - b := make([]byte, 17) + b := make([]byte, 21) if _, err := rs.Read(b); err != nil { return false, err } @@ -2293,7 +2291,7 @@ func isWebPAnimation(rs io.ReadSeeker) (bool, error) { return bytes.Equal(b[:4], []byte("RIFF")) && bytes.Equal(b[8:16], []byte("WEBPVP8X")) && - b[16]&0b00000010 != 0, nil + b[20]&0b00000010 != 0, nil } var errIsAnimation = errors.New("cannot perceptually hash animations") -- cgit v1.2.3-70-g09d2