summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-29 14:54:17 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-29 14:54:17 +0100
commit644bcefd71339d58483f1a7c4a94ac7ff9c4dc75 (patch)
treee0f301d4f7ec676219c917ad5e5c2b747a5f20e7 /main.go
parent19db1b17c184cca2073bf395568a4841953d2629 (diff)
downloadgallery-original.tar.gz
gallery-original.tar.xz
gallery-original.zip
Resolve issuesoriginal
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 3 insertions, 5 deletions
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")