Bug #19475 » Thumbnails.diff
typo3_src-4.2.2/t3lib/thumbs.php 2008-10-28 05:47:41.000000000 +0100 | ||
---|---|---|
$sizeParts = explode('x', $this->size.'x'.$this->size); // explodes the input size (and if no "x" is found this will add size again so it is the same for both dimensions)
|
||
$sizeParts = array(t3lib_div::intInRange($sizeParts[0],1,1000),t3lib_div::intInRange($sizeParts[1],1,1000)); // Cleaning it up, only two parameters now.
|
||
$this->size = implode('x',$sizeParts); // Imploding the cleaned size-value back to the internal variable
|
||
$sizeMax = max($sizeParts); // Getting max value
|
||
// Init
|
||
$outpath = PATH_site.$this->outdir;
|
||
... | ... | |
if ($TYPO3_CONF_VARS['GFX']['im']) {
|
||
// If thumbnail does not exist, we generate it
|
||
if (!@file_exists($this->output)) {
|
||
/* if (strstr($this->input,' ') || strstr($this->output,' ')) {
|
||
$this->errorGif('Spaces in','filepath',basename($this->input));
|
||
}
|
||
*/ // 16 colors for small (56) thumbs, 64 for bigger and all for jpegs
|
||
if ($outext=='jpg') {
|
||
$colors = '';
|
||
} else {
|
||
$colors = ($sizeMax>56)?'-colors 64':'-colors 16';
|
||
}
|
||
$parameters = '-sample '.$this->size.' '.$colors.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
|
||
$parameters = '-sample '.$this->size.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
|
||
$cmd = t3lib_div::imageMagickCommand('convert', $parameters);
|
||
exec($cmd);
|
||
if (!@file_exists($this->output)) {
|
- « Previous
- 1
- 2
- Next »