Code Duplication    Length = 5-7 lines in 2 locations

src/Elphin/IcoFileLoader/Ico.php 2 locations

@@ 322-328 (lines=7) @@
319
                //we translate the BGRA to aRGB ourselves, which is twice as fast
320
                //as calling imagecolorallocatealpha
321
                $alpha7 = ((~ord($binary[$offset + 3])) & 0xff) >> 1;
322
                if ($alpha7 < 127) {
323
                    $col = ($alpha7 << 24) |
324
                        (ord($binary[$offset + 2]) << 16) |
325
                        (ord($binary[$offset + 1]) << 8) |
326
                        (ord($binary[$offset]));
327
                    imagesetpixel($im, $j, $i, $col);
328
                }
329
                $offset += 4;
330
            }
331
        }
@@ 347-351 (lines=5) @@
344
345
        for ($i = $metadata['Height'] - 1; $i >= 0; --$i) {
346
            for ($j = 0; $j < $metadata['Width']; ++$j) {
347
                if ($maskBits[$bitoffset] == 0) {
348
                    //translate BGR to RGB
349
                    $col = (ord($binary[$offset + 2]) << 16) |
350
                        (ord($binary[$offset + 1]) << 8) |
351
                        (ord($binary[$offset]));
352
                    imagesetpixel($im, $j, $i, $col);
353
                }
354
                $offset += 3;