Code Duplication    Length = 17-17 lines in 2 locations

src/CImage/CImage.php 2 locations

@@ 1270-1286 (lines=17) @@
1267
     *
1268
     * @return $this
1269
     */
1270
    public function setJpegQuality($quality = null)
1271
    {
1272
        if ($quality) {
1273
            $this->useQuality = true;
1274
        }
1275
1276
        $this->quality = isset($quality)
1277
            ? $quality
1278
            : self::JPEG_QUALITY_DEFAULT;
1279
1280
        (is_numeric($this->quality) and $this->quality > 0 and $this->quality <= 100)
1281
            or $this->raiseError('Quality not in range.');
1282
1283
        $this->log("Setting JPEG quality to {$this->quality}.");
1284
1285
        return $this;
1286
    }
1287
1288
1289
@@ 1297-1313 (lines=17) @@
1294
     *
1295
     * @return $this
1296
     */
1297
    public function setPngCompression($compress = null)
1298
    {
1299
        if ($compress) {
1300
            $this->useCompress = true;
1301
        }
1302
1303
        $this->compress = isset($compress)
1304
            ? $compress
1305
            : self::PNG_COMPRESSION_DEFAULT;
1306
1307
        (is_numeric($this->compress) and $this->compress >= -1 and $this->compress <= 9)
1308
            or $this->raiseError('Quality not in range.');
1309
1310
        $this->log("Setting PNG compression level to {$this->compress}.");
1311
1312
        return $this;
1313
    }
1314
1315
1316