( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/../includes/codeProfilePicBg.php
<?php
//get stage size
$themeid = $_GET["theme_id"];
 $row = getParamJSONTheme($themeid);

	 
  $params = json_decode("[".$row['params']."]");
$widthX = $params[0]->width;
  $heightX = $params[0]->height;
	 
  $picme=profilepicture();
$layer_x=0;
					 $layer_y=0;
 					  $layer_w=$widthX;
					 $layer_h=$heightX;
					 $layeropacity=100;
				 $layer_r=0;
				  
				 $brand=$picme;
					  
	  		 $amount=100;$sizeW=7; $sizeH=7; $posX=0; $posY=0;$gridWidth=10;$gridHeight=10;
  
  
  
  		 $cellWidth = $width / $gridWidth;
 $cellHeight = $height / $gridHeight;			
 		
	

 

    // Getting top left and bottom right of our rectangle
    $topLeftX = $realPosX;
    $realPosY = $realPosY;
    $bottomRightX = $realPosX + $realSizeW;
    $bottomRightY = $realPosY + $realSizeH;

    // Conversion of our virtual sizes/positions to real ones
    $realSizeW = ($cellWidth * $sizeW)-2; //with borders
    $realSizeH = ($cellHeight * $sizeH)-2;
	
	    $realSizeW = $layer_w; //with borders
    $realSizeH = $layer_h;


    $realPosX = $layer_x;
    $realPosY = $layer_y;

    // Getting top left and bottom right of our rectangle
    $topLeftX = $realPosX;
    $realPosY = $realPosY;
    $bottomRightX = $realPosX + $realSizeW;
    $bottomRightY = $realPosY + $realSizeH;

 						
					 
			 
				 	  
	  		 $picture = explode('.',$brand);
		
         $ext = strtolower($picture[1]); 
		 
 


$imageFolder ="v/uploads/gthumbs/$brand";

 switch ($ext)
{
	case 'gif':
		// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
		// This is maybe not the ideal solution, but IE6 can suck it
		$creationFunction	= 'ImageCreateFromGif';
		$outputFunction		= 'ImagePng';
		$mime				= 'image/png'; // We need to convert GIFs to PNGs
		$doSharpen			= FALSE;
		$quality			= round(10 - ($quality / 10)); // We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
	break;
	
	case 'png':
	
		$creationFunction	= 'ImageCreateFromPng';
		$outputFunction		= 'ImagePng';
		$doSharpen			= FALSE;
		$quality			= round(10 - ($quality / 10)); // PNG needs a compression level of 0 (no compression) through 9
	break;
	
	default:
		$creationFunction	= 'ImageCreateFromJpeg';
		$outputFunction	 	= 'ImageJpeg';
		$doSharpen			= FALSE;
	break;
}

 

	$brand = $creationFunction("v/uploads/gthumbs/$brand");
	
	 
/*		
	if(!empty($_GET['convoId']))
					{	
$rowTweets = getEachJSONTweets($_GET['convoId']); 
$data ="[$rowTweets]";
$json = json_decode($data);		
$profile_image_url = $json[0]->user->profile_image_url;
$picme = str_replace("_normal","",$profile_image_url) ;
		
		
$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $picme); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // good edit, thanks!
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); // also, this seems wise considering output is image.
    $data = curl_exec($ch);
    curl_close($ch);

    $brand = imagecreatefromstring($data);
	
	
	
	  }
	*/
	$foto2W 		= imagesx($brand); 
	$foto2H 		= imagesy($brand);
	
 
			$srcRatio = $foto2W /   $foto2H;
			$targetRatio = $realSizeW / $realSizeH;
			
			if ( $srcRatio >= $targetRatio )
			{
			   // If image is wider than thumbnail (in aspect ratio sense)
			   $background2H = $realSizeH;
			   $background2W = $foto2W / (  $foto2H / $realSizeH);
			}
			else
			{
			   // If the thumbnail is wider than the image
			   $background2W = $realSizeW;
			   $background2H =   $foto2H / ($foto2W / $realSizeW);
			}

	$background2 = imagecreatetruecolor( $realSizeW, $realSizeH );
	
	
$brand = imagecopyresampled($background2,
                   $brand,
                   0 - ($background2W - $realSizeW) / 2, // Center the image horizontally
                   0 - ($background2H - $realSizeH) / 2, // Center the image vertically
                   0, 0,
                   $background2W, $background2H,
                   $foto2W,   $foto2H);
 
	
	  imagecopyresampled($background, $brand, $realPosX, $realPosY, 0, 0, $realSizeW, $realSizeH, imagesx($brand), imagesy($brand));

	 
	 
		imagecopy($background, $background2,$topLeftX, $realPosY, 0, 0, imagesx($background2), imagesy($background2));