summaryrefslogtreecommitdiff
path: root/webapp.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 /webapp.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 'webapp.py')
-rwxr-xr-xwebapp.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp.py b/webapp.py
index 6c6f5b4..260268a 100755
--- a/webapp.py
+++ b/webapp.py
@@ -14,7 +14,10 @@ from dedup.utils import fetchiter
hash_functions = [
("sha512", "sha512"),
- ("image_sha512", "image_sha512"),
+ ("png_sha512", "png_sha512"),
+ ("png_sha512", "gif_sha512"),
+ ("gif_sha512", "png_sha512"),
+ ("gif_sha512", "gif_sha512"),
("gzip_sha512", "gzip_sha512"),
("sha512", "gzip_sha512"),
("gzip_sha512", "sha512")]
@@ -87,6 +90,11 @@ class Application(object):
elif endpoint == "detail":
return self.show_detail(args["package1"], args["package2"])
elif endpoint == "hash":
+ if args["function"] == "image_sha512":
+ # backwards compatibility
+ raise RequestRedirect("%s/hash/png_sha512/%s" %
+ (request.environ["SCRIPT_NAME"],
+ args["hashvalue"]))
return self.show_hash(args["function"], args["hashvalue"])
elif endpoint == "index":
if not request.environ["PATH_INFO"]: