From 020a55f56ac2f71091cf1b3798f9a22a798da3e2 Mon Sep 17 00:00:00 2001 From: tmccormi Date: Mon, 21 Mar 2011 16:39:24 -0700 Subject: [PATCH] Fixed path to convert files using imagemagick --- interface/patient_file/report/custom_report.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/interface/patient_file/report/custom_report.php b/interface/patient_file/report/custom_report.php index 6578727ad..af8ff601c 100644 --- a/interface/patient_file/report/custom_report.php +++ b/interface/patient_file/report/custom_report.php @@ -327,20 +327,19 @@ foreach ($ar as $key => $val) { else { // echo "NOTE: ".xl('Document')."'" . $fname ."' ".xl('cannot be displayed inline because its type is not supported by the browser.')."

"; // This requires ImageMagick to be installed. - $url_file = $d->get_url_filepath(); - // just grab the last two levels, which contain filename and patientid - $from_all = explode("/",$url_file); - $from_filename = array_pop($from_all); - $from_patientid = array_pop($from_all); - $from_file = $GLOBALS["fileroot"].'/documents/'.$from_patientid.'/'.$from_filename; + $url_file = $d->get_url_filepath(); + // just grab the last two levels, which contain filename and patientid + $from_all = explode("/",$url_file); + $from_filename = array_pop($from_all); + $from_patientid = array_pop($from_all); + $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .'/documents/'. $from_patientid.'/'.$from_filename; $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg'; if (! is_file($to_file)) exec("convert -density 200 \"$from_file\" -append -resize 850 \"$to_file\""); if (is_file($to_file)) { - echo "

"; + echo "

"; } else { echo "NOTE: " . xl('Document') . "'" . $fname . "' " . - xl('cannot be converted to JPEG. Perhaps ImageMagick is not installed?') . - "

"; + xl('cannot be converted to JPEG. Perhaps ImageMagick is not installed?') . "

"; } } // end if-else } // end Documents loop -- 2.11.4.GIT