Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

KCL #1

Open
wants to merge 95 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
68ea45d
Fixed contrast initialization to use parseFloat() rather than parseInt()
ruven Jun 15, 2012
b439e88
* Updated iip protocol class to new class API
ruven Jun 19, 2012
2910ee0
Merge branch 'master' of https://github.com/ruven/iipmooviewer.git
Jul 6, 2012
c3665cf
Dependency injection for protocols. So it is possible to create your …
Jul 6, 2012
b12a475
Correctly construct metadata urls for the djatoka protocol.
ruven Jul 11, 2012
a9663a8
Simplified passing of arguments to tile onload handler
ruven Jul 11, 2012
08ffd24
Annotation editing code added included via annotations-edit.js
ruven Jul 11, 2012
b7d9a04
More annotation editing changes including CSS improvements.
ruven Jul 11, 2012
c07c1fc
Get correct image regions
Jul 11, 2012
d958e9c
Grab thumbnails
Jul 11, 2012
071d197
Simplify and fix the getMultiplier function, retain some metadata for…
Jul 11, 2012
23d23a4
Make sure not to pass a flat to svc.scale, it freaks djatoka out.
Jul 11, 2012
d25dd97
Merge pull request #5 from rsofaer/djatoka-support
ruven Jul 12, 2012
428d8c0
Changes to protocol getRegionURL() functions
ruven Jul 12, 2012
143c5e3
Also updated iipmooviewer getRegionURL() function to work with new pr…
ruven Jul 12, 2012
c9baf3c
getRegionURL support for djatoka
Jul 12, 2012
bdd66f1
Merge pull request #6 from rsofaer/djatoka-regionURL
ruven Jul 12, 2012
95a8831
* Changes to annotation list structure. Must now supply a JSON friend…
ruven Jul 13, 2012
dff9fa0
Merge branch 'master' of github.com:ruven/iipmooviewer
ruven Jul 13, 2012
899d5ed
Fix to README markup
ruven Jul 13, 2012
af63cf8
Fix to minified js file and update to README
ruven Jul 18, 2012
78c5758
Merge upstream/master
Jul 20, 2012
c1a77b2
Added support for getMetaData in protocol. if function exists then it…
Jul 20, 2012
5c6064a
Change this to _this to avoid an error
Jul 24, 2012
4163d32
Merge pull request #7 from rsofaer/ios-fixes
ruven Jul 24, 2012
8701a6e
Merge branch 'master' of https://github.com/ruven/iipmooviewer.git
Aug 10, 2012
2a7a836
Changes to focus/blur of container div to fix key press bug. Now uses…
Sep 15, 2012
a080e17
Added check for whether current instance exists within synchronizatio…
Sep 15, 2012
5d58b03
Add various events firing.
Sep 20, 2012
04466c4
New Estonian localization. Thanks to the National Archives of Estonia.
ruven Sep 21, 2012
4eb60ac
Fix to Deepzoom protocol to use specified format identifier.
ruven Sep 25, 2012
274cea3
Another fix to deepzoom.js for variable formats
ruven Sep 26, 2012
2635f11
Yet another fix for the deepzoom protocol. Automatically strip off th…
ruven Sep 26, 2012
fc6f7df
Change to allow navigation window to be more independent and be moved…
ruven Sep 27, 2012
638a910
New Turkish localization. Thanks to Serkan Kesim.
ruven Sep 28, 2012
d7b6a2f
Fixed conflicts after merge with master branch of ruven repository
Oct 3, 2012
ea6718d
Some more fixes after merge
Oct 3, 2012
e5879b8
* Added new blending module (src/blending.js) for use with image comp…
ruven Oct 3, 2012
fab0182
Changed HTML template to use Google Mootools CDN. The iipmooviewer co…
ruven Oct 3, 2012
2b9ef40
Minor update to README
ruven Oct 3, 2012
6722a6e
Modified CSS for use with blending module.
ruven Oct 3, 2012
dcfd307
Update the compressed version.
Oct 3, 2012
75b95a2
Add the possibility to get resolutions from the protocol,
Oct 9, 2012
45c097d
Merged updates from ruven repo
Oct 9, 2012
fb703c4
Fix calculation of zooming factor to depend on actual resolutions.
Oct 9, 2012
9188e98
Add option rotationStep.
Oct 11, 2012
653bbf5
Added scale unit option for use with degrees for astronomy
ruven Oct 17, 2012
db61543
Fix bug with option rotationStep for multi touch gestures.
Oct 17, 2012
6442f44
Fire onMove event after nudge (moving from keyboard).
Oct 25, 2012
2ae8285
Fire onKeyPress event for easy extension of shortcuts.
Oct 26, 2012
4d9da58
Merged updates from ruven repo
Oct 26, 2012
5d43d94
Added in missing "' value="' +" to annotation edit code - Joe Padfield.
ruven Oct 26, 2012
0ee9de3
Fixes for synchronized viewing on touch devices.
ruven Oct 27, 2012
63209c7
New Swedish translation and fix to Turkish translation by Serkan Kesim.
ruven Nov 12, 2012
f8d1b7c
* Minor cleanup to CSS.
ruven Nov 12, 2012
e3d38bf
Minor change to README
ruven Nov 12, 2012
b241f93
Merged updates from ruven repo
Nov 20, 2012
0ea31c2
Rough rotation fix.
Nov 27, 2012
af1ca79
Rough rotation fix.
Nov 28, 2012
29c349c
Rough rotation fix.
Nov 28, 2012
04dba93
Mainly fix moving after rotation.
Nov 28, 2012
994df16
Fix remembering position on rotation.
Nov 29, 2012
ee0f1de
Fix zooming depending on cursor.
Nov 29, 2012
028bf3d
Fix moving after rotation for touch devices.
Dec 3, 2012
6c0339b
Refactoring.
Dec 3, 2012
8e8261b
Refactoring.
Dec 3, 2012
5b2d425
Fix moving with the keyboard arrows after rotation.
Dec 3, 2012
723668b
Remove debug info.
Dec 3, 2012
856ca46
Fix zoom with two clicks in touch devices to zoom where the clicks are.
Dec 3, 2012
5f193eb
Fire onMove event if moving with touches.
Dec 4, 2012
73bfb9f
Add compressed version.
Dec 5, 2012
5d424fa
Add additional method for getting rotated left and top.
Dec 6, 2012
4146bc4
Makes method getPositiveRotation public.
Dec 6, 2012
73d3e19
Fires move event if zooming changes our position.
Dec 6, 2012
a0d208a
Fixed conflicts from amitsev merge
Dec 7, 2012
825c619
Fix for changing image without navigator loaded.
Dec 11, 2012
9b95880
Fix bug in resolutions building.
Dec 12, 2012
c9b0bf5
Make annotations to float with the mouse.
Dec 13, 2012
40b4920
Fix rotation with two fingers to remember correctly the view focus.
Dec 17, 2012
b83c747
Add compressed version.
Dec 17, 2012
34cb835
Fix display of annotations.
Dec 17, 2012
43289dc
Merge origin/amitsev
Dec 17, 2012
e891cd7
Zoom with scrolling also outside of the image.
Jan 31, 2013
b9bc2a9
Load tiles on move, not after the move stops.
Jan 31, 2013
410edb7
Fix a problem where zooming caused scrolling of page.
Feb 1, 2013
34d88b8
Merge master in amitsev.
Feb 18, 2013
684c702
Merge master in amitsev.
Feb 18, 2013
71740c8
Fix issue with rounding down when calculating the resolutions.
May 14, 2013
52d60c6
Add beforeZoom and tilesLoaded events. refs #16327
Jun 25, 2014
cf7e43e
Fix for missing navigator on image change with protocol without getMe…
May 14, 2015
a261438
Enable touchmove for the document. Seems to be ok. refs #21248
May 15, 2015
58b8e8b
Add alt attribute to tiles. To cover Webrichtlijnen (WCAG). refs #22361
Jul 22, 2015
0276387
Add alt attribute to help icon. To cover Webrichtlijnen (WCAG). refs …
Jul 22, 2015
dc22c42
Add possibility for custom alt text. refs #22452
Jul 27, 2015
407bedd
Change image with protocol which provides metadata url only does not …
Sep 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 121 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ IIPMooViewer

About
-----
IIPMooViewer is a high performance light-weight HTML5 Ajax-based javascript image streaming and zooming client designed for the IIPImage high resolution imaging system. It is compatible with Firefox, Chrome, Internet Explorer (Versions 6-10), Safari and Opera as well as mobile touch-based browsers for iOS and Android. Although designed for use with the IIP protocol and IIPImage, it has multi-protocol support and is additionally compatible with the Zoomify and Deepzoom protocols.
IIPMooViewer is a high performance light-weight HTML5 Ajax-based javascript image streaming and zooming client designed for the IIPImage high resolution imaging system. It is compatible with Firefox, Chrome, Internet Explorer (Versions 6-10), Safari and Opera as well as mobile touch-based browsers for iOS and Android. Although designed for use with the IIP protocol and IIPImage, it has multi-protocol support and is additionally compatible with the Zoomify, Deepzoom and Djatoka (OpenURL) protocols.

Version 2.0 of IIPMooViewer is HTML5/CSS3 based and uses the Mootools javascript framework (version 1.4+).

Expand All @@ -13,7 +13,7 @@ Features
--------
* Fast and light-weight
* Pan and zoom of ultra high resolution imaging
* Multi-protocol support: IIP, Zoomify and Deepzoom protocols
* Multi-protocol support: IIP, Zoomify, Deepzoom and Djatoka (OpenURL) protocols
* Image rotation
* Mobile device support: iOS and Android
* HTML5 Fullscreen API support
Expand Down Expand Up @@ -60,10 +60,10 @@ Distribution

Minified files are created with the closer compiler (https://developers.google.com/closure/compiler/) with the following command:
<pre>
java -jar /path/to/compiler.jar --js src/iipmooviewer-2.0.js src/protocols/iip.js src/protocols/zoomify.js src/protocols/deepzoom.js src/annotations.js src/lang/help.en.js --js_output_file javascript/iipmooviewer-2.0-compressed.js --compilation_level SIMPLE_OPTIMIZATIONS
java -jar /path/to/compiler.jar --js src/mootools-more-1.4.0.1.js src/iipmooviewer-2.0.js src/protocols/iip.js src/annotations.js src/blending.js src/lang/help.en.js --js_output_file javascript/iipmooviewer-2.0-compressed.js --compilation_level SIMPLE_OPTIMIZATIONS
</pre>

You can thereby customize your build to include only those components you need. For example, if you do not require Zoomify or annotation support, simply remove these from the build. Make sure, however, that the core iipmooviewer js file is included before the other components.
You can thereby customize your build to include only those components you need. For example, if you require Zoomify or do not require annotation support, simply add or remove these from the build. Make sure, however, that the core iipmooviewer js file is included before the other components. Otherwise, if you prefer not to rebuild, use the default build and add the extra components you want as extra includes.


Options
Expand Down Expand Up @@ -92,9 +92,19 @@ option is the <b>image</b> variable)
<b>navWinSize</b> : ratio of navigation window size to the main window.
Wide panoramas are scaled to twice this size [default: 0.2]

<b>scale</b> : adds a scale to the image. Specify the number of pixels per mm
<b>scale</b> : adds a scale to the image. Specify the number of pixels per unis. Should be given in pixels per mm if the default meter unit is used. Otherwise pixels per degree if degree units are used.

<b>prefix</b>: path prefix if image subdirectory moved (for example to a different host) [default "images/"]
<b>units</b> : define the units used. Can be in degrees or meters [default: meters]. Or define completely new unit system. The default structure is the following:
<pre>
{
dims: ["pm", "nm", "&#181;m", "mm", "cm", "m", "km"], // Unit suffixes
orders: [ 1e-12, 1e-9, 1e-6, 0.001, 0.01, 1, 1000 ], // Unit orders
mults: [1,2,5,10,50,100], // Different scalings usable for each unit
factor: 1000 // Default multiplication factor
}
</pre>

<b>prefix</b>: path prefix if image subdirectory moved (for example to a different host) [default: "images/"]

<b>enableFullscreen</b> : allow full screen mode. If "native" will attempt to use Javascript Fullscreen API. Otherwise it will fill the viewport. "page" allows fullscreen but only in viewport fill mode. False disables. [default: "native"]

Expand All @@ -107,7 +117,7 @@ option is the <b>image</b> variable)

<b>preload</b> : preload an extra layer of tiles surrounding the viewport [default: false]

<b>annotations</b> : An array of annotations containing struct with parameters "x", "y", "w", "h", "title", "text", "category" where x, y, w and h are the position and size of the annotation in relative [0-1] values, title is an optional title for the annotation, category is an optional category for the annotation and text is the body of the annotation
<b>annotations</b> : An object containing object structures with parameters "x", "y", "w", "h", "title", "text", "category" where x, y, w and h are the position and size of the annotation in relative [0-1] values, title is an optional title for the annotation, category is an optional category for the annotation and text is the body of the annotation


Public Functions
Expand All @@ -116,7 +126,7 @@ Public Functions
<b>getRegionURL()</b>: If using the default IIP protocol, this functions returns the IIPImage server URL needed to export the region of the image within the view port as a single image. Thus, to export the current view, call this function and use the result as the source of an image. This example exports, when the user presses the "p" key, the view into a new window which can then be saved as a whole image.
<pre>
window.addEvent('keypress', function(e){
if( e.key == "p" ) window.open(iipmooviewer.getRegionURL());
if( e.key == "p" ) window.open(iipmooviewer.getRegionURL());
});
</pre>

Expand Down Expand Up @@ -147,12 +157,67 @@ Public Functions

Annotations
-----------
x,y,w and h are obligatory parameters. The text parameter provides the content of the annotation and can contain any valid HTML, which can be styled normally via CSS. All annotations are created as divs of class "annotation".
The title and category parameters are optional. Categories are ways of creating groups of annotations and the category will be added to the class. Thus for a category of, for example, 'retouches' the annotation divs will be of class 'annotation retouches', allowing you to access these via a class selector. So, for example, to set the colors of these differently to the others, simply use a selector:
You can supply a list of annotations for the image which will be overlaid while navigating the image. These must be supplied in an object containing a list of individual annotation objects, each with parameters describing the position, title, category and text for the annotation. The position is described by the x,y,w and h properties (obligatory) which describe the size independent top left coordinate of the annotation and it's size. The text parameter provides the content of the annotation and can contain any valid HTML, which can be styled normally via CSS. All annotations are created as divs of class "annotation".

For example:
<pre>
var annotations = {
1 : { x: 0.7, y: 0.6, w: 0.2, h: 0.18, category: "pigments", text: "prussian blue" },
2: { x: 0.1, y: 0.8, w: 0.15, h: 0.1, category: "pigments", text: "azurite" },
3: { x: 0.7, y: 0.4, w: 0.1, h: 0.1, category: "people", text: "Mary" }
};
</pre>

The 1,2,3 are unique ID's which can be either numeric or strings.

Categories are ways of creating groups of annotations and the category will be added to the class. Thus for a category of, for example, 'retouches' the annotation divs will be of class 'annotation retouches', allowing you to access these via a class selector. So, for example, to set the colors of these differently to the others, simply with javascript, use a selector:
<pre>
$$('.annotation.retouches').setStyle('borderColor', "blue")
</pre>

or in CSS:
<pre>
.annotation.retouches{
border-color: blue;
}
</pre>

Annotation editing is possible by including the annotations-edit.js file, which extends the IIPMooViewer class. The function newAnnotation() creates a new blank annotation in the centre of the view. Double click on any existing annotation to move, resize of modify it. When an update occurs, an annotationChange event occurs, which can be captured and used to send the results back to a server via an AJAX call.

For example, to send the updated list of annotations back to annotations.php:

<pre>
iipmooviewer.addEvent('annotationChange', function(){
var metadata = new Request.JSON({
method: 'post',
url: 'annotations.php',
data: {
json: JSON.encode(this.annotations)
}
}).send();
});
</pre>


Synchronized Views
------------------
It is possible to synchronize two or more instances of iipmooviewer, so that they will zoom, pan and rotate at the same time. To do this, simply create your viewers and synchronize them together using the IIPMooViewer.synchronize() function, which takes an array of viewer instances. For example:

<pre>
// Create viewers
var viewer1 = new IIPMooViewer( "viewer1", {
image: 'image1.tif'
});
var viewer2 = new IIPMooViewer( "viewer2", {
image: 'image2.tif',
showNavWindow: false, // Only show navigation window on first viewer
showNavButtons: false
});

// Synchronize our viewers
IIPMooViewer.synchronize([viewer2,viewer1]);
</pre>


Events
------
Expand All @@ -164,9 +229,54 @@ IIPMooViewer fires the 'load' event when it has fully finished loading. To attac
</pre>


Protocols
---------
IIPMooViewer supports the IIP, Zoomify, Deepzoom and Djatoka protocols. By default it will use IIP, but to use, for example Zoomify, first include the protocol after the other javascript includes as this is not included by default:

<pre>
&lt;script type="text/javascript" src="src/protocols/zoomify.js"&gt;&lt;/script&gt;
</pre>

Protocols such as zoomify don't have a server as such, so set this value to / or to the path prefix for the image. For example, if you have an image with URL /images/zoomify/image1, use:

<pre>
new IIPMooViewer( "viewer", {
server: "/images/zoomify/",
image: "image1",
protocol: "zoomify"
});
</pre>

Note that for Deepzoom, the image name should be name of the .dzi or .xml Deepzoom index file.

Localization
------------
To create a new localization, create a new or modify an existing localization file in /lang
To create a new localization, create a new or modify an existing localization file in the src/lang folder and include this extra
file.

For example for Chinese, create lang/help.zh.js and simply include it after the main iipmooviewer include:
<pre>
&lt;script type="text/javascript" src="javascript/mootools-core-1.4.5-full-nocompat-yc.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="javascript/iipmooviewer-2.0-compressed.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="src/lang/help.zh.js"&gt;&lt;/script&gt;
</pre>

Image Blending
--------------
It's also possible to load several images for comparison and dynamically blend between them to compare. This is useful, for example, for comparing scientific imagery of the same scene or object. Images should be of the same size and registered. The blending component is in src/blending.js, but is built by default into the main compressed iipmooviewer js file in the javascript/ folder. To use, simply load the the viewer as normal with the default image, but use the blend() function to provide a list of all images and text for use in the selection box. For eample:

<pre>
var iipmooviewer = new IIPMooViewer( "targetframe", {
image: 'color.tif',
credit: 'Compare scientific images'
});

iipmooviewer.blend( [ ['color.tif','color'],
['uv.tif','ultra-violet'],
['ir.tif','infra-red'],
['xray.tif','X-ray']
] );
</pre>


------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion css/ie.compressed.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions css/ie.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ html{ overflow: auto; } /* To eliminate unnecessary vertical scrollbars in IE6/7

/* IE7 interpolation fix */
img { -ms-interpolation-mode: bicubic; }

/* Blending box */
div.blending{ filter: alpha(opacity=60) }
div.blending:hover{ filter: alpha(opacity=100) }

Loading