Added check so render returns with false if unsupported platform.

This commit is contained in:
thepurpleblob
2005-06-28 14:12:45 +00:00
parent 18a2407ef4
commit 64ffa2a243
+12 -2
View File
@@ -44,14 +44,19 @@
}
else {
$this->supported_platform = false;
return false;
}
$this->path_latex = "{$binpath}latex";
$this->path_dvips = "{$binpath}dvips";
$this->path_convert = "{$binpath}convert";
$this->path_identify = "{$binpath}identify";
}
return true;
/**
* Accessor function for support_platform field.
* @return boolean value of supported_platform
*/
function supported() {
return $this->supported_platform;
}
/**
@@ -101,6 +106,11 @@
* @return bool true if successful
*/
function render( $formula, $filename, $fontsize=12, $density=240, $background='', $log=null ) {
// quick check - will this work?
if (!$this->supported_platform) {
return false;
}
$doc = $this->construct_latex_document( $formula, $fontsize );
// construct some file paths