From 6c90d4668589396367ae93920b790e09e347ce0b Mon Sep 17 00:00:00 2001 From: andrpet Date: Thu, 5 May 2016 15:33:35 +0200 Subject: [PATCH] leafletjs --- .gitignore | 4 ++++ configuration.xml | 4 ++-- export/.htaccess | 3 +++ export/deepexport.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ export/index.php | 35 +++++++++++++++++++++++++++++++++++ export/pbrtpa.bmp | Bin 0 -> 24650 bytes index.php | 2 +- 7 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 export/.htaccess create mode 100644 export/deepexport.php create mode 100644 export/index.php create mode 100644 export/pbrtpa.bmp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd9f437 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Created by .ignore support plugin (hsz.mobi) + +.gitignore +configuration.xml diff --git a/configuration.xml b/configuration.xml index ffd561c..b1852f6 100755 --- a/configuration.xml +++ b/configuration.xml @@ -1,11 +1,11 @@ - http://192.168.164.128/DatalEts-Ecosystem-Provider/COMPONENTS/datalets/ + http://172.16.15.77/DEEalerProvider/COMPONENTS/datalets/ - http://192.168.164.128/DatalEts-Ecosystem-Provider/COMPONENTS/controllets/ + http://172.16.15.77/DEEalerProvider/COMPONENTS/controllets/ diff --git a/export/.htaccess b/export/.htaccess new file mode 100644 index 0000000..a7b90e2 --- /dev/null +++ b/export/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^ index.php [QSA,L] \ No newline at end of file diff --git a/export/deepexport.php b/export/deepexport.php new file mode 100644 index 0000000..4f50928 --- /dev/null +++ b/export/deepexport.php @@ -0,0 +1,61 @@ +app = new \Slim\Slim(); + + $this->app->post('/export-datalet-as-img', function(){ + if(!empty($this->app->request()->params('svg_data'))) { + try { + $svg = $this->app->request()->params('svg_data'); + + $chart = new Imagick(); + $chart->setFormat('SVG'); + $chart->readImageBlob($svg); + $chart->setFormat("png24"); + + $logo = new Imagick(); + $logo->readImage("pbrtpa.bmp"); + + $image = new Imagick(); + $image->setFormat("png24"); + $image->newImage($chart->getImageWidth() > $logo->getImageHeight() ? $chart->getImageWidth() : $logo->getImageWidth(), + $chart->getImageHeight()+$logo->getImageHeight(), + "white"); + + $image->compositeImage($chart, Imagick::COMPOSITE_COPY, 0, 0); + $image->compositeImage($logo, Imagick::COMPOSITE_COPY, 20, $chart->getImageHeight()); + + echo $image; + }catch (Exception $e){} + } + }); + } + + public function run(){ + //run the Slim app + $this->app->run(); + } +} \ No newline at end of file diff --git a/export/index.php b/export/index.php new file mode 100644 index 0000000..63c724c --- /dev/null +++ b/export/index.php @@ -0,0 +1,35 @@ +run(); \ No newline at end of file diff --git a/export/pbrtpa.bmp b/export/pbrtpa.bmp new file mode 100644 index 0000000..c11023b Binary files /dev/null and b/export/pbrtpa.bmp differ diff --git a/index.php b/index.php index 7e882be..f7f44dd 100755 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ @license The MIT License (MIT) - Copyright (c) 2015 Dipartimento di Informatica - Università di Salerno - Italy + Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- libgit2 0.21.4