summaryrefslogtreecommitdiff
path: root/update_sharing.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2013-08-01 23:06:26 +0200
committerHelmut Grohne <helmut@subdivi.de>2013-08-01 23:06:26 +0200
commit2712edb550968ce7ec8cd9800241d7944666631a (patch)
treec213907b81aaad6cc7ab07fc7ea809f32fcb5fbe /update_sharing.py
parentd3f68ad766b1c33867c2c504b0f5e6d9bb7cbf03 (diff)
downloaddebian-dedup-2712edb550968ce7ec8cd9800241d7944666631a.tar.gz
support hashing gif images
* Rename "image_sha512" to "png_sha512". * dedup.image.ImageHash is now a base class for image hashes such as PNGHash and GIFHash. * Enable both hashes in importpkg. * Fix README. * Add new hash combinations to webapp. * Add "gif file not named *.gif" to issues in update_sharing. * Add redirect for "image_sha512" to webapp for backwards compatibility.
Diffstat (limited to 'update_sharing.py')
-rwxr-xr-xupdate_sharing.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/update_sharing.py b/update_sharing.py
index 910662e..5ec6c7b 100755
--- a/update_sharing.py
+++ b/update_sharing.py
@@ -56,7 +56,8 @@ def main():
[(row[1],) for row in rows])
process_pkgdict(cur, pkgdict)
cur.execute("INSERT INTO issue (cid, issue) SELECT content.id, 'file named something.gz is not a valid gzip file' FROM content WHERE content.filename LIKE '%.gz' AND NOT EXISTS (SELECT 1 FROM hash JOIN function ON hash.fid = function.id WHERE hash.cid = content.id AND function.name = 'gzip_sha512');")
- cur.execute("INSERT INTO issue (cid, issue) SELECT content.id, 'png image not named something.png' FROM content JOIN hash ON content.id = hash.cid JOIN function ON hash.fid = function.id WHERE function.name = 'image_sha512' AND lower(filename) NOT LIKE '%.png';")
+ cur.execute("INSERT INTO issue (cid, issue) SELECT content.id, 'png image not named something.png' FROM content JOIN hash ON content.id = hash.cid JOIN function ON hash.fid = function.id WHERE function.name = 'png_sha512' AND lower(filename) NOT LIKE '%.png';")
+ cur.execute("INSERT INTO issue (cid, issue) SELECT content.id, 'gif image not named something.gif' FROM content JOIN hash ON content.id = hash.cid JOIN function ON hash.fid = function.id WHERE function.name = 'gif_sha512' AND lower(filename) NOT LIKE '%.gif';")
db.commit()
if __name__ == "__main__":