*/
public function raw($convert = false)
{
- if (!empty($this->_data)) {
+ if (empty($this->_data) ||
// If there are no operations, and we already have data, don't
// bother writing out files, just return the current data.
- if (!$convert &&
- !count($this->_operations) &&
- !count($this->_postSrcOperations)) {
- return $this->_data;
- }
-
- $tmpin = $this->toFile($this->_data);
+ (!$convert &&
+ !count($this->_operations) &&
+ !count($this->_postSrcOperations))) {
+ return $this->_data;
}
+ $tmpin = $this->toFile($this->_data);
+
// Perform convert command if needed
if (count($this->_operations) || count($this->_postSrcOperations) || $convert) {
$tmpout = Horde_Util::getTempFile('img', false, $this->_tmpdir);
$this->_logDebug(sprintf("convert command executed by Horde_Image_im::raw(): %s", $command));
exec($command, $output, $retval);
if ($retval) {
- $this->_logErr(sprintf("Error running command: %s"), $command . "\n" . implode("\n", $output));
+ $this->_logErr(sprintf("Error running command: %s", $command . "\n" . implode("\n", $output)));
}
/* Empty the operations queue */