Code Duplication    Length = 17-17 lines in 2 locations

src/CImage/CImage.php 2 locations

@@ 1181-1197 (lines=17) @@
1178
     *
1179
     * @return $this
1180
     */
1181
    public function setJpegQuality($quality = null)
1182
    {
1183
        if ($quality) {
1184
            $this->useQuality = true;
1185
        }
1186
1187
        $this->quality = isset($quality)
1188
            ? $quality
1189
            : self::JPEG_QUALITY_DEFAULT;
1190
1191
        (is_numeric($this->quality) and $this->quality > 0 and $this->quality <= 100)
1192
            or $this->raiseError('Quality not in range.');
1193
1194
        $this->log("Setting JPEG quality to {$this->quality}.");
1195
1196
        return $this;
1197
    }
1198
1199
1200
@@ 1208-1224 (lines=17) @@
1205
     *
1206
     * @return $this
1207
     */
1208
    public function setPngCompression($compress = null)
1209
    {
1210
        if ($compress) {
1211
            $this->useCompress = true;
1212
        }
1213
1214
        $this->compress = isset($compress)
1215
            ? $compress
1216
            : self::PNG_COMPRESSION_DEFAULT;
1217
1218
        (is_numeric($this->compress) and $this->compress >= -1 and $this->compress <= 9)
1219
            or $this->raiseError('Quality not in range.');
1220
1221
        $this->log("Setting PNG compression level to {$this->compress}.");
1222
1223
        return $this;
1224
    }
1225
1226
1227