Commit 48b99cda authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added option "$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = 'no_imagecopyresized_fix';" to avoid using the imagecopyresized workaround in stdgraphic class which has failed for some. Whether the workaround is needed anymore is not certain. Some people say it works fine without.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@226 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 0472bb70
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added option "$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = 'no_imagecopyresized_fix';" to avoid using the imagecopyresized workaround in stdgraphic class which has failed for some. Whether the workaround is needed anymore is not certain. Some people say it works fine without.
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added TypoScript condition "hostname" for matching hostnames for IP addresses.
......
......@@ -3172,11 +3172,20 @@ class t3lib_div {
* @return object The object
*/
function &makeInstance($className) {
if (class_exists('ux_'.$className)) {
return t3lib_div::makeInstance('ux_'.$className);
} else {
return new $className;
}
return class_exists('ux_'.$className) ? t3lib_div::makeInstance('ux_'.$className) : new $className;
}
/**
* Return classname for new instance
* Takes the class-extensions API of TYPO3 into account
*
* Usage: 18
*
* @param string Base Class name to evaluate
* @return string Final class name to instantiate with "new [classname]"
*/
function makeInstanceClassName($className) {
return class_exists('ux_'.$className) ? t3lib_div::makeInstanceClassName('ux_'.$className) : $className;
}
/**
......@@ -3219,19 +3228,6 @@ class t3lib_div {
return $error;
}
/**
* Return classname for new instance
* Takes the class-extensions API of TYPO3 into account
*
* Usage: 18
*
* @param string Base Class name to evaluate
* @return string Final class name to instantiate with "new [classname]"
*/
function makeInstanceClassName($className) {
return class_exists('ux_'.$className)?t3lib_div::makeInstanceClassName('ux_'.$className):$className;
}
/**
* Simple substitute for the PHP function mail().
* The fifth parameter, $enc, will allow you to specify 'base64' encryption for the output (set $enc=base64)
......
......@@ -146,6 +146,7 @@ class t3lib_stdGraphic {
var $combineScript = 'combine'; // The ImageMagick filename used for combining two images. This name changed during the versions.
var $noFramePrepended=0; // If set, there is no frame pointer prepended to the filenames.
var $GD2=0; // Set, if the GDlib used is version 2.
var $imagecopyresized_fix=0; // If set, imagecopyresized will not be called directly. For GD2 (some PHP installs?)
var $gifExtension = 'gif'; // This should be changed to 'png' if you want this class to read/make PNG-files instead!
var $TTFLocaleConv = ''; // Used to recode input to TTF-functions for other charsets.
var $enable_typo3temp_db_tracking = 0; // If set, then all files in typo3temp will be logged in a database table. In addition to being a log of the files with original filenames, it also serves to secure that the same image is not rendered simultaneously by two different processes.
......@@ -222,7 +223,8 @@ class t3lib_stdGraphic {
if ($gfxConf['im_noFramePrepended']) $this->noFramePrepended=1;
if ($gfxConf['gdlib_2']) {
$this->GD2=1;
$this->GD2 = 1;
$this->imagecopyresized_fix = $gfxConf['gdlib_2']==='no_imagecopyresized_fix' ? 0 : 1;
}
if ($gfxConf['gdlib_png']) {
$this->gifExtension='png';
......@@ -444,7 +446,7 @@ class t3lib_stdGraphic {
}
/**
* Alternative function for using the similat PHP function imagecopyresized(). Used for GD2 only.
* Alternative function for using the similar PHP function imagecopyresized(). Used for GD2 only.
*
* OK, the reason for this stupid fix is the following story:
* GD1.x was capable of copying two images together and combining their palettes! GD2 is apparently not.
......@@ -476,7 +478,7 @@ class t3lib_stdGraphic {
* @see t3lib_iconWorks::imagecopyresized()
*/
function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h) {
if ($this->GD2) {
if ($this->imagecopyresized_fix) {
$im_base = imagecreatetruecolor(imagesx($im), imagesy($im)); // Make true color image
imagecopyresized($im_base, $im, 0,0,0,0, imagesx($im),imagesy($im),imagesx($im),imagesy($im)); // Copy the source image onto that
imagecopyresized($im_base, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h); // Then copy the $cpImg onto that (the actual operation!)
......@@ -1908,7 +1910,7 @@ class t3lib_stdGraphic {
if ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
if ($row['md5hash']!=$md5Hash) {
// file has changed, delete the row
$TYPO3_DB->exec_DELETEquery ('cache_imagesizes', 'md5hash="'.$TYPO3_DB->quoteStr($row['md5hash']).'"');
$TYPO3_DB->exec_DELETEquery ('cache_imagesizes', 'md5hash="'.$TYPO3_DB->quoteStr($row['md5hash'], 'cache_imagesizes').'"');
} else {
return (array($row['imagewidth'], $row['imageheight'], strtolower($reg[0]), $imageFile));
}
......
......@@ -27,7 +27,7 @@ $TYPO3_CONF_VARS = Array(
'gdlib' => 1, // Boolean. Enables the use of GD.
'gdlib_png' => 0, // Boolean. Enables the use of GD, with PNG only. This means that all items normally generated as gif-files will be png-files instead!
'gdlib_2' => 0, // Boolean. Set this if you are using the new GDlib 2.0.1+. If you don't set this flag and still uses GDlib2, you might encounter strange behaviours like black images etc. This feature might take effect only if ImageMagick is installed and working as well! GD2 support is still very much untested and beta.
'gdlib_2' => 0, // String/Boolean. Set this if you are using the new GDlib 2.0.1+. If you don't set this flag and still uses GDlib2, you might encounter strange behaviours like black images etc. This feature might take effect only if ImageMagick is installed and working as well! You can also use the value "no_imagecopyresized_fix" - in that case it will NOT try to fix a known issue where "imagecopyresized" does not work correctly.
'im' => 1, // Boolean. Enables the use of IM.
'im_path' => '/usr/X11R6/bin/', // Path to the IM tools 'convert', 'combine', 'identify'. Version 4.2.9 of ImageMagick is highly recommended due to features and speed!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment