Showing 7,873 of 7,873 total issues
Avoid deeply nested control flow statements. Open
Open
for ($i = 0; $i < $firstbyte; $i++) {
$col = $pixelcounter % $thisfile_bmp_header_raw['width'];
$row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
$thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$secondbyte];
$pixelcounter++;
Avoid deeply nested control flow statements. Open
Open
while (($pixeldataoffset % 4) != 0) {
// lines are padded to nearest DWORD
$pixeldataoffset++;
}
Avoid deeply nested control flow statements. Open
Open
for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
$pixelvalue = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8));
$pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8;
$red = (int) round(((($pixelvalue & $thisfile_bmp_header_raw[ 'red_mask']) >> $redshift) / ($thisfile_bmp_header_raw[ 'red_mask'] >> $redshift)) * 255);
Avoid deeply nested control flow statements. Open
Open
for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
$paletteindexbyte = ord($BMPpixelData[$pixeldataoffset++]);
for ($i = 1; $i >= 0; $i--) {
$paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i);
$thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
Avoid deeply nested control flow statements. Open
Open
switch ($secondbyte) {
case 0:
// end of line
// no need for special processing, just ignore
break;
Avoid deeply nested control flow statements. Open
Open
while (($pixeldataoffset % 4) != 0) {
// lines are padded to nearest DWORD
$pixeldataoffset++;
}
Avoid deeply nested control flow statements. Open
Open
if (strlen($imgdata) <= $this->maxb) {
imagetruecolortopalette($this->gdimg_output, true, pow(2, $i));
break;
}
Avoid deeply nested control flow statements. Open
Open
if ($imagetypes & IMG_PNG) {
$gd_info['PNG Support'] = true;
}
Method URLreadFsock
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=-1, $timeout=10) {
Avoid deeply nested control flow statements. Open
Open
if ($imagetypes & IMG_JPG) {
$gd_info['JPG Support'] = true;
}
Method Frame
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function Frame(&$gdimg, $frame_width, $edge_width, $hexcolor_frame, $hexcolor1, $hexcolor2) {
Avoid deeply nested control flow statements. Open
Open
if ($imagetypes & IMG_GIF) {
$gd_info['GIF Create Support'] = true;
}
Avoid deeply nested control flow statements. Open
Open
for ($y = $watermark_margin_y; $y < ($img_source_height + $watermark_source_height); $y += ($watermark_source_height + $watermark_margin_y)) {
imagecopy(
$gdimg_tiledwatermark,
$img_watermark,
$x,
Method WatermarkOverlay
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacity=50, $margin_x=5, $margin_y=null) {
Avoid deeply nested control flow statements. Open
Open
if (!isset($PixelMap[$x][$y]['alpha']) || ($PixelMap[$x][$y]['alpha'] > 0)) {
if (isset($PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha']) && ($PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha'] < 127)) {
$thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha']);
imagesetpixel($gdimg_dropshadow_temp, $x, $y, $thisColor);
}
Method ScaleToFitInBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function ScaleToFitInBox($width, $height, $maxwidth=null, $maxheight=null, $allow_enlarge=true, $allow_reduce=true) {
Avoid deeply nested control flow statements. Open
Open
if ($imagetypes & IMG_WBMP) {
$gd_info['WBMP Support'] = true;
}
Avoid deeply nested control flow statements. Open
Open
if ($tempfilename = phpthumb::phpThumb_tempnam()) {
if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
fwrite($fp_tempfile, base64_decode('R0lGODlhAQABAIAAAH//AP///ywAAAAAAQABAAACAUQAOw==')); // very simple 1px GIF file base64-encoded as string
fclose($fp_tempfile);
$phpthumb_temp = new phpthumb();
Avoid deeply nested control flow statements. Open
Open
switch ($errno) {
case 200:
// great, continue
break;
Method DropShadow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha) {