]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/images/class_BaseImage.php
Continued:
[core.git] / framework / main / classes / images / class_BaseImage.php
index ae8fb1b2957456297f2d40070818897dbe7a3ee5..cb08935a0192d39382e5d17e483f4621d80e16ad 100644 (file)
@@ -462,12 +462,9 @@ abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
         * @return      void
         */
        public function finishImage () {
-               // Get template instance
-               $templateInstance = $this->getTemplateInstance();
-
                // Compile width and height
-               $width = $templateInstance->compileRawCode($this->getWidth());
-               $height = $templateInstance->compileRawCode($this->getHeight());
+               $width = $this->getTemplateInstance()->compileRawCode($this->getWidth());
+               $height = $this->getTemplateInstance()->compileRawCode($this->getHeight());
 
                // Set both again
                $this->setWidth($width);
@@ -477,9 +474,9 @@ abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
                $this->imageResource = imagecreatetruecolor($width, $height);
 
                // Compile background colors
-               $red   = $templateInstance->compileRawCode($this->backgroundColor['red']);
-               $green = $templateInstance->compileRawCode($this->backgroundColor['green']);
-               $blue  = $templateInstance->compileRawCode($this->backgroundColor['blue']);
+               $red   = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['red']);
+               $green = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['green']);
+               $blue  = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['blue']);
 
                // Set all back
                $this->initBackgroundColor();
@@ -494,9 +491,9 @@ abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
                imagefill($this->getImageResource(), 0, 0, $backColor);
 
                // Compile foreground colors
-               $red   = $templateInstance->compileRawCode($this->foregroundColor['red']);
-               $green = $templateInstance->compileRawCode($this->foregroundColor['green']);
-               $blue  = $templateInstance->compileRawCode($this->foregroundColor['blue']);
+               $red   = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['red']);
+               $green = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['green']);
+               $blue  = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['blue']);
 
                // Set all fore
                $this->initForegroundColor();
@@ -510,15 +507,15 @@ abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
                switch ($this->groupable) {
                        case 'single': // Single image string
                                // Compile image string
-                               $imageString = $templateInstance->compileRawCode($this->getString());
+                               $imageString = $this->getTemplateInstance()->compileRawCode($this->getString());
 
                                // Set it back
                                $this->setString($imageString);
 
                                // Compile X/Y coordinates and font size
-                               $x    = $templateInstance->compileRawCode($this->getX());
-                               $y    = $templateInstance->compileRawCode($this->getY());
-                               $size = $templateInstance->compileRawCode($this->getFontSize());
+                               $x    = $this->getTemplateInstance()->compileRawCode($this->getX());
+                               $y    = $this->getTemplateInstance()->compileRawCode($this->getY());
+                               $size = $this->getTemplateInstance()->compileRawCode($this->getFontSize());
 
                                // Set the image string
                                imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
@@ -526,17 +523,17 @@ abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
 
                        case 'groupable': // More than one string allowed
                                // Walk through all groups
-                               foreach ($templateInstance->getVariableGroups() as $group => $set) {
+                               foreach ($this->getTemplateInstance()->getVariableGroups() as $group => $set) {
                                        // Set the group
-                                       $templateInstance->setVariableGroup($group, false);
+                                       $this->getTemplateInstance()->setVariableGroup($group, false);
 
                                        // Compile image string
-                                       $imageString = $templateInstance->compileRawCode($this->getString());
+                                       $imageString = $this->getTemplateInstance()->compileRawCode($this->getString());
 
                                        // Compile X/Y coordinates and font size
-                                       $x    = $templateInstance->compileRawCode($this->getX());
-                                       $y    = $templateInstance->compileRawCode($this->getY());
-                                       $size = $templateInstance->compileRawCode($this->getFontSize());
+                                       $x    = $this->getTemplateInstance()->compileRawCode($this->getX());
+                                       $y    = $this->getTemplateInstance()->compileRawCode($this->getY());
+                                       $size = $this->getTemplateInstance()->compileRawCode($this->getFontSize());
 
                                        // Set the image string
                                        //* DEBUG: */ print __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";