diff --git a/docs/software-requirements.md b/docs/software-requirements.md index e204ef1dcc..40f46b522b 100644 --- a/docs/software-requirements.md +++ b/docs/software-requirements.md @@ -25,7 +25,7 @@ Open XDMoD requires the following software: - [Chromium][] - `chromium-headless` is assumed, but chromium has been known to work - [libRsvg][] -- [ghostscript][] 9+ +- [exiftool][] - [cron][] - [logrotate][] - [MTA][] with `sendmail` compatibility (e.g. [postfix][], [exim][] or @@ -54,7 +54,7 @@ Open XDMoD requires the following software: [jdk]: http://www.oracle.com/technetwork/java/javase/downloads/index.html [chromium]: https://www.chromium.org/Home [librsvg]: https://wiki.gnome.org/Projects/LibRsvg -[ghostscript]: https://www.ghostscript.com/ +[exiftool]: http://www.sno.phy.queensu.ca/%7Ephil/exiftool/ [cron]: https://en.wikipedia.org/wiki/Cron [logrotate]: https://linux.die.net/man/8/logrotate [mta]: https://en.wikipedia.org/wiki/Message_transfer_agent diff --git a/docs/upgrade.md b/docs/upgrade.md index 7fe4ef3ca8..b78d09d753 100644 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -88,8 +88,8 @@ changed in the new version. You do not need to merge If you have manually edited this file, you should create a backup and merge any changes after running the upgrade script. -*NOTE: This upgrade changes the dependency on `PhantomJS` to `chromium` and `libRSVG`. These new dependencies will need to be manually installed. See the [Software Requirements](software-requirements.html) for more details. -`PhantomJS` is no longer required by Open XDMoD and will need to be removed manually.* +*NOTE: This upgrade removes the `PhantomJS` and `ghostscript` dependencies; it adds dependencies of `chromium`, `libRSVG` and `exiftool`. These new dependencies will need to be manually installed. See the [Software Requirements](software-requirements.html) for more details. +`PhantomJS` is no longer required, however, it WILL NOT be removed automatically; it will need to be removed manually.* ### Verify Server Configuration Settings @@ -108,8 +108,8 @@ enhancements and bug fixes. You may upgrade directly from 9.0.0. -*NOTE: This upgrade changes the dependency on `PhantomJS` to `chromium` and `libRSVG`. These new dependencies will be automatically installed by the RPM. -`PhantomJS` WILL NOT be removed automatically; it will need to be removed manually.* +*NOTE: This upgrade removes the `PhantomJS` and `ghostscript` dependencies; it adds dependencies of `chromium`, `libRSVG` and `exiftool`.. These new dependencies will be automatically installed by the RPM. +`PhantomJS` is no longer required, however, it WILL NOT be removed automatically; it will need to be removed manually.* ### Configuration File Changes diff --git a/libraries/charting.php b/libraries/charting.php index 38b56cb77d..54d27b66da 100644 --- a/libraries/charting.php +++ b/libraries/charting.php @@ -166,7 +166,7 @@ function getScreenFromChromium($file, $width, $height, $format){ function svg2pdf($inputFilename, $width, $height, $metaData){ $outputFilename = $inputFilename . '.pdf'; - $command = 'rsvg-convert -f pdf -o ' . $outputFilename . ' ' . $inputFilename; + $command = 'rsvg-convert -w ' .$width. ' -h '.$height.' -f pdf -o ' . $outputFilename . ' ' . $inputFilename; $pipes = array(); $descriptor_spec = array( 0 => array('pipe', 'r'), @@ -189,67 +189,37 @@ function svg2pdf($inputFilename, $width, $height, $metaData){ if ($return_value != 0) { throw new \Exception("$command returned $return_value, stdout: $out stderr: $err"); } - $data = getPdfWithMetadata($outputFilename, $width, $height, $metaData); + $data = getPdfWithMetadata($outputFilename, $metaData); @unlink($outputFilename); return $data; } /** - * @param array $docmenta array with optional author, subject and title elements - * @return string valid pdfmark postscript for use by ghostscript - */ -function getPdfMark($docmeta) -{ - $author = isset($docmeta['author']) ? addcslashes($docmeta['author'], "()\n\\") : 'XDMoD'; - $subject = isset($docmeta['subject']) ? addcslashes($docmeta['subject'], "()\n\\") : 'XDMoD chart'; - $title = isset($docmeta['title']) ? addcslashes($docmeta['title'], "()\n\\") :'XDMoD PDF chart export'; - $creator = addcslashes('XDMoD ' . OPEN_XDMOD_VERSION, "()\n\\"); - - $pdfmark = << array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'), ); - $process = proc_open($command, $descriptor_spec, $pipes); if (!is_resource($process)) { throw new \Exception('Unable execute command: "'. $command . '". Details: ' . print_r(error_get_last(), true)); } - - fwrite($pipes[0], getPdfMark($docmeta)); - fclose($pipes[0]); - $out = stream_get_contents($pipes[1]); $err = stream_get_contents($pipes[2]); @@ -261,6 +231,5 @@ function getPdfWithMetadata($pdfFilename, $widthPsPoints, $heightPsPoints, $docm if ($return_value != 0) { throw new \Exception("$command returned $return_value, stdout: $out stderr: $err"); } - return $out; } diff --git a/open_xdmod/modules/xdmod/xdmod.spec.in b/open_xdmod/modules/xdmod/xdmod.spec.in index 2e0c1479a2..4b87498d26 100644 --- a/open_xdmod/modules/xdmod/xdmod.spec.in +++ b/open_xdmod/modules/xdmod/xdmod.spec.in @@ -1,4 +1,4 @@ -Name: xdmod +name: xdmod Version: __VERSION__ Release: __RELEASE__%{?dist} Summary: Data warehouse and web portal for mining statistical data from resource managers @@ -20,7 +20,7 @@ Requires: chromium-headless Requires: librsvg2-tools Requires: crontabs Requires: logrotate -Requires: ghostscript +Requires: perl-Image-ExifTool Requires: jq %description @@ -96,6 +96,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Tue Aug 18 2020 XDMoD 9.5.0-1.0 - Add `chromium-headless` and `librsvg2-tools` to required dependencies + - Replace `ghostscript` with `exiftool` * Thu Aug 13 2020 XDMoD 9.0.0-1.0 - Release 9.0.0 - Add `mod_ssl` to required dependencies