Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
even better now
  • Loading branch information
leanderseige committed Nov 26, 2018
1 parent 962daf8 commit 69db8d9
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 35 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -4,11 +4,14 @@

ANTLITZ.NINJA was developed for the [Coding da Vinci Hackathon Rhein-Main 2018](https://codingdavinci.de/events/rheinmain/). ANTLITZ.NINJA is a web-based application to create new pieces of art from existing paintings and drawings. ANTLITZ.NINJA is compatible with the International Image Interoperability Framework (IIIF).

BEWARE! ANTLITZ.NINJA is a hack, it is not intended to demonstrate exemplary programming, it was built to work.

### Software

* OpenSeadragon
* OpenCV
* JQuery
* and others

### Data

Expand Down
61 changes: 34 additions & 27 deletions antlitzninja.js
Expand Up @@ -4,6 +4,9 @@
(c) 2018, Leander Seige, leander@seige.name
https://antlitz.ninja
https://github.com/leanderseige/antlitz.ninja
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -484,6 +487,13 @@ function antlitzninja(config) {

}

antlitzninja.prototype.launch_download_dialog = function () {
av.show('#splash');
av.show('#download');
download_mode="manifest";
this.create_image();
}

antlitzninja.prototype.downloadImage = function() {
download_mode="image";
$("#download").hide();
Expand All @@ -498,13 +508,6 @@ function antlitzninja(config) {
this.create_image();
}

antlitzninja.prototype.downloadManifest = function() {
download_mode="manifest";
$("#download").hide();
$("#loader").show();
this.create_image();
}

antlitzninja.prototype.create_image = function() {
var deleteme = document.getElementById('deleteme');
if (deleteme) {
Expand Down Expand Up @@ -540,7 +543,7 @@ function antlitzninja(config) {
var m = JSONC.pack(create_dynafest(w,eimgurl,nimgurl,mimgurl));
m = m.replace(/\//g, "%2F");
m = m.replace(/\+/g, "%2B");
console.log(m);
$('#button_dynamic_manifest').attr("href", "https://antlitz.ninja./manifest.php?m="+m)
return;
}

Expand All @@ -564,7 +567,7 @@ function antlitzninja(config) {

function create_UUID(){
var dt = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var uuid = 'xxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (dt + Math.random()*16)%16 | 0;
dt = Math.floor(dt/16);
return (c=='x' ? r :(r&0x3|0x8)).toString(16);
Expand All @@ -578,6 +581,7 @@ function antlitzninja(config) {
var m = {};
m['@context'] = "http://iiif.io/api/presentation/2/context.json";
m['@type'] = "sc:Manifest";
m['label'] = "anm";
m['@id'] = 'https://antlitz.ninja/uuid/'+id;
var s = [];
s[0] = {};
Expand All @@ -587,34 +591,37 @@ function antlitzninja(config) {
c[0] = {}
c[0]['@id'] = m['@id']+'/c/0';
c[0]['@type'] = "sc:Canvas";
c[0]['format'] = "image/jpeg";
c[0]['label'] = "anc";
c[0]['height'] = w;
c[0]['width'] = w;
c[0]['thumbnail'] = {};
c[0]['thumbnail']['@id'] = osde.id+"/0,0,300,300/full/0/default.jpg";
var i = [];
i[0] = {};
i[0]['on'] = c[0]['@id'];
i[0]['@id'] = m['@id']+'/i/0';
i[0]['on'] = c[0]['@id']+"#xywh=0,0,100,50";
i[0]['@type'] = "oa:Annotation";
i[0]["@context"] = "http://iiif.io/api/presentation/2/context.json";
i[0]['motivation'] = "sc:painting";
i[0]['resource'] = {};
i[0]['resource']['@type'] = "dctypes:Image";
i[0]['resource']['format'] = "image/jpeg";
i[0]['resource']['height'] = w;
i[0]['resource']['width'] = w;
i[0]['resource']['service'] = {};
i[0]['resource']['service']['profile'] = "http://iiif.io/api/image/2/level1.json";
i[0]['resource']['service']['@context'] = "http://iiif.io/api/image/2/context.json";
i[0]['resource']['selector']= {};
i[0]['resource']['selector']['@context'] = "http://iiif.io/api/annex/openannotation/context.json";
i[0]['resource']['selector']['@type'] = "iiif:ImageApiSelector";
i[0]['resource']['selector']['region'] = "0,0,1000,1000";
i[1] = i[0];
i[2] = i[0];
i[0]['resource']['service']['@id'] = osde.id;
i[0]['resource']['service']['@id'] = osdn.id;
i[0]['resource']['service']['@id'] = osdm.id;
i[0]['resource']['@id'] = pe;
i[0]['resource']['@type'] = "dctypes:Image";
i[0]['resource']["format"] = "image/jpeg";

i[1] = JSON.parse(JSON.stringify(i[0]));
i[2] = JSON.parse(JSON.stringify(i[0]));
i[1]['@id'] = m['@id']+'/i/1';
i[2]['@id'] = m['@id']+'/0/2';
i[1]['resource']['@id'] = pn;
i[2]['resource']['@id'] = pm;

i[1]['on'] = c[0]['@id']+"#xywh=0,50,100,20";
i[2]['on'] = c[0]['@id']+"#xywh=0,70,100,30";

c[0]['images'] = i;
s[0]['canvases'] = c;
m['sequences'] = s;

return m;
}

Expand Down
3 changes: 3 additions & 0 deletions css/styles-mobile.css
Expand Up @@ -4,6 +4,9 @@
(c) 2018, Leander Seige, leander@seige.name
https://antlitz.ninja
https://github.com/leanderseige/antlitz.ninja
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
3 changes: 3 additions & 0 deletions css/styles.css
Expand Up @@ -4,6 +4,9 @@
(c) 2018, Leander Seige, leander@seige.name
https://antlitz.ninja
https://github.com/leanderseige/antlitz.ninja
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
17 changes: 10 additions & 7 deletions index.html
Expand Up @@ -6,6 +6,9 @@
(c) 2018, Leander Seige, leander@seige.name
https://antlitz.ninja
https://github.com/leanderseige/antlitz.ninja
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -113,7 +116,7 @@
<div class="icons mainmenu" onclick="av.zoomInAll();">&#xf00e;</div>
<div class="icons mainmenu" onclick="av.zoomOutAll();">&#xf010;</div>
<div class="icons mainmenu" onclick="av.resetAll();">&#xf049;</div>
<div class="icons mainmenu" onclick="av.show('#splash');av.show('#download');">&#xf56d;</div>
<div class="icons mainmenu" onclick="av.launch_download_dialog();">&#xf56d;</div>
<div class="icons mainmenu" onclick="av.show('#splash');av.show('#metadata');">&#xf05a;</div>
<div class="icons mainmenu" onclick="av.show('#splash');av.show('#impressum');"><img src="images/antlitz.ninja.icon.svg" /></div>
</div>
Expand Down Expand Up @@ -148,15 +151,15 @@
</div>

<div id="download" class="splash_content" style="display:none">
<a onclick="av.downloadImage();" id="download_button">
<a onclick="av.downloadImage();" id="button_download_image">
<span class="mainmenu icons">&#xf03e;</span><br />
Download Image
</a>
<br />
<br />
<hr />
<br />
<a onclick="av.downloadPDF();" id="download_button">
<a onclick="av.downloadPDF();" id="button_download_pdf">
<span class="mainmenu icons">&#xf1c1;</span><br />
Download PDF
</a>
Expand All @@ -166,16 +169,16 @@
<hr />
<br />
<br />
<!--a onclick="av.downloadManifest();" id="download_button">
<span class="mainmenu icons">&#xf1c1;</span><br />
Download Manifest
<a id="button_dynamic_manifest" class="splash_content" target="_blank">
<span class="mainmenu icons"><img class="linkon" src="images/iiif.svg" /></span><br />
Link Manifest
</a>
<br />
<br />
<br />
<hr />
<br />
<br /-->
<br />
<span class="icons" style="color:black;" onclick="$('#splash').hide();$('#download').hide();">&#xf057;</span>
</div>

Expand Down
24 changes: 23 additions & 1 deletion manifest.php
@@ -1,6 +1,28 @@
<?php

/* not used yet */
/*
ANTLITZ.NINJA
(c) 2018, Leander Seige, leander@seige.name
https://antlitz.ninja
https://github.com/leanderseige/antlitz.ninja
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

function decode_gzip( $data )
{
Expand Down

0 comments on commit 69db8d9

Please sign in to comment.