1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

(kind of) fix for #1011 and little corrections for PDF export

This commit is contained in:
Thomas Citharel 2015-01-19 23:19:09 +01:00
parent 894cd087f4
commit 1cedeb681f
2 changed files with 38 additions and 10 deletions

View file

@ -2926,12 +2926,18 @@ class TCPDF {
*/
public function Error($msg) {
// unset all class variables
$this->_destroy(true);
throw new Exception('TCPDF ERROR: '.$msg);
/*
I had problems with the constants for some reason, so here we force
$this->_destroy(true);
if (defined('K_TCPDF_THROW_EXCEPTION_ERROR') AND !K_TCPDF_THROW_EXCEPTION_ERROR) {
die('<strong>TCPDF ERROR: </strong>'.$msg);
} else {
throw new Exception('TCPDF ERROR: '.$msg);
}
}*/
}
/**
@ -6915,7 +6921,7 @@ class TCPDF {
$ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k;
$imsize = array($pw, $ph);
} else {
$this->Error('[Image] Unable to get the size of the image: '.$file);
$this->Error('[Image] Unable to fetch image: '.$file);
}
}
// file hash