Code Duplication    Length = 18-18 lines in 3 locations

library/Zebra_Image.php 3 locations

@@ 1286-1303 (lines=18) @@
1283
            // flip according to $orientation
1284
            switch ($orientation) {
1285
1286
                case 'horizontal':
1287
1288
                    imagecopyresampled(
1289
1290
                        $target_identifier, $this->source_identifier, 0, 0, $this->source_width - 1, 0, $this->source_width, $this->source_height, -$this->source_width, $this->source_height
1291
1292
                    );
1293
1294
                    break;
1295
1296
                case 'vertical':
1297
1298
                    imagecopyresampled(
1299
1300
                        $target_identifier, $this->source_identifier, 0, 0, 0, $this->source_height - 1, $this->source_width, $this->source_height, $this->source_width, -$this->source_height
1301
1302
                    );
1303
1304
                    break;
1305
1306
                case 'both':
@@ 1296-1313 (lines=18) @@
1293
1294
                    break;
1295
1296
                case 'vertical':
1297
1298
                    imagecopyresampled(
1299
1300
                        $target_identifier, $this->source_identifier, 0, 0, 0, $this->source_height - 1, $this->source_width, $this->source_height, $this->source_width, -$this->source_height
1301
1302
                    );
1303
1304
                    break;
1305
1306
                case 'both':
1307
1308
                    imagecopyresampled(
1309
1310
                        $target_identifier, $this->source_identifier, 0, 0, $this->source_width - 1, $this->source_height - 1, $this->source_width, $this->source_height, -$this->source_width, -$this->source_height
1311
1312
                    );
1313
1314
                    break;
1315
1316
            }
@@ 1306-1323 (lines=18) @@
1303
1304
                    break;
1305
1306
                case 'both':
1307
1308
                    imagecopyresampled(
1309
1310
                        $target_identifier, $this->source_identifier, 0, 0, $this->source_width - 1, $this->source_height - 1, $this->source_width, $this->source_height, -$this->source_width, -$this->source_height
1311
1312
                    );
1313
1314
                    break;
1315
1316
            }
1317
1318
            // write image
1319
            return $this->_write_image($target_identifier);
1320
        }
1321
1322
        // if script gets this far, return false
1323
        // note that we do not set the error level as it has been already set
1324
        // by the _create_from_source() method earlier
1325
        return false;
1326
    }