Code Duplication    Length = 8-11 lines in 2 locations

thumbs/phpthumb.class.php 2 locations

@@ 1110-1120 (lines=11) @@
1107
        if (strtolower($this->f) == 'jpg') {
1108
            $this->f = 'jpeg';
1109
        }
1110
        if (phpthumb_functions::CaseInsensitiveInArray($this->config_output_format, $AvailableImageOutputFormats)) {
1111
            // set output format to config default if that format is available
1112
            $this->DebugMessage('$this->thumbnailFormat set to $this->config_output_format "' . strtolower($this->config_output_format) . '"', __FILE__, __LINE__);
1113
            $this->thumbnailFormat = strtolower($this->config_output_format);
1114
        } elseif ($this->config_output_format) {
1115
            $this->DebugMessage('$this->thumbnailFormat staying as "'
1116
                                . $this->thumbnailFormat
1117
                                . '" because $this->config_output_format ('
1118
                                . strtolower($this->config_output_format)
1119
                                . ') is not in $AvailableImageOutputFormats', __FILE__, __LINE__);
1120
        }
1121
        if ($this->f && phpthumb_functions::CaseInsensitiveInArray($this->f, $AvailableImageOutputFormats)) {
1122
            // override output format if $this->f is set and that format is available
1123
            $this->DebugMessage('$this->thumbnailFormat set to $this->f "' . strtolower($this->f) . '"', __FILE__, __LINE__);
@@ 1121-1128 (lines=8) @@
1118
                                . strtolower($this->config_output_format)
1119
                                . ') is not in $AvailableImageOutputFormats', __FILE__, __LINE__);
1120
        }
1121
        if ($this->f && phpthumb_functions::CaseInsensitiveInArray($this->f, $AvailableImageOutputFormats)) {
1122
            // override output format if $this->f is set and that format is available
1123
            $this->DebugMessage('$this->thumbnailFormat set to $this->f "' . strtolower($this->f) . '"', __FILE__, __LINE__);
1124
            $this->thumbnailFormat = strtolower($this->f);
1125
        } elseif ($this->f) {
1126
            $this->DebugMessage('$this->thumbnailFormat staying as "' . $this->thumbnailFormat . '" because $this->f (' . strtolower($this->f) . ') is not in $AvailableImageOutputFormats', __FILE__,
1127
                                __LINE__);
1128
        }
1129
1130
        // for JPEG images, quality 1 (worst) to 99 (best)
1131
        // quality < 25 is nasty, with not much size savings - not recommended