# HG changeset patch # User Robert Casties # Date 1504712540 -7200 # Node ID 2184c0ef4b303ce33ed458faa327a563043357d2 # Parent 8aea51cbf614ff4c1bf68cd8f7a7dfd930df3ab9 new optional per-image hints for DocuImage. diff -r 8aea51cbf614 -r 2184c0ef4b30 common/src/main/java/digilib/image/DocuImage.java --- a/common/src/main/java/digilib/image/DocuImage.java Wed Sep 06 17:41:38 2017 +0200 +++ b/common/src/main/java/digilib/image/DocuImage.java Wed Sep 06 17:42:20 2017 +0200 @@ -318,4 +318,20 @@ * @param hackString */ public void setHacks(String hackString); + + /** + * Set optional image specific hints with additional information. + * + * @param key + * @param value + */ + public void setHint(String key, Object value); + + /** + * Returns the image specific hint with the given key. + * + * @param key + * @return + */ + public Object getHint(String key); } diff -r 8aea51cbf614 -r 2184c0ef4b30 common/src/main/java/digilib/image/DocuImageImpl.java --- a/common/src/main/java/digilib/image/DocuImageImpl.java Wed Sep 06 17:41:38 2017 +0200 +++ b/common/src/main/java/digilib/image/DocuImageImpl.java Wed Sep 06 17:42:20 2017 +0200 @@ -33,6 +33,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import org.apache.log4j.Logger; @@ -68,6 +69,9 @@ /** ImageInput that was read */ protected ImageInput input; + + /** image specific hints */ + protected Map hints; /** * Returns the version. @@ -228,4 +232,20 @@ // doing nothing } + /* (non-Javadoc) + * @see digilib.image.DocuImage#setHint(java.lang.String, java.lang.Object) + */ + @Override + public void setHint(String key, Object value) { + hints.put(key, value); + } + + /* (non-Javadoc) + * @see digilib.image.DocuImage#getHint(java.lang.String) + */ + @Override + public Object getHint(String key) { + return hints.get(key); + } + }