From 9334a6e5ea4ba89c243b2e5d6bdb02db6aa012ff Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 8 Jun 2015 14:58:31 +0100 Subject: [PATCH] Add basic ::same for RawImageProxy and J2KImageProxy. --- src/lib/image_proxy.cc | 6 ++++++ src/lib/image_proxy.h | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc index c803e6bd0..0b079725d 100644 --- a/src/lib/image_proxy.cc +++ b/src/lib/image_proxy.cc @@ -46,3 +46,9 @@ image_proxy_factory (shared_ptr xml, shared_ptr socket) throw NetworkError (_("Unexpected image type received by server")); } + +bool +ImageProxy::same (shared_ptr other) const +{ + return image()->digest() == other->image()->digest(); +} diff --git a/src/lib/image_proxy.h b/src/lib/image_proxy.h index 39cbda27d..9367bc0a7 100644 --- a/src/lib/image_proxy.h +++ b/src/lib/image_proxy.h @@ -64,9 +64,7 @@ public: virtual void add_metadata (xmlpp::Node *) const = 0; virtual void send_binary (boost::shared_ptr) const = 0; /** @return true if our image is definitely the same as another, false if it is probably not */ - virtual bool same (boost::shared_ptr) const { - return false; - } + virtual bool same (boost::shared_ptr) const; }; boost::shared_ptr image_proxy_factory (boost::shared_ptr xml, boost::shared_ptr socket); -- 2.30.2