# Want to edit this php code slightly

**URL:** https://forum.kirupa.com/t/want-to-edit-this-php-code-slightly/254884
**Category:** Uncategorized
**Created:** [March 16, 2008, 10:15pm UTC](https://forum.kirupa.com/t/want-to-edit-this-php-code-slightly/254884 "2008-03-16T22:15:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ma501th](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@ma501th](https://forum.kirupa.com/u/ma501th)
#### Post date: [March 16, 2008, 10:15pm UTC](https://forum.kirupa.com/t/want-to-edit-this-php-code-slightly/254884/1 "2008-03-16T22:15:50Z")

</div>

hi,

this is an open source which i picked up from somwhere on this site, the only adjustment i need to make is to increase the size (height n width) of the output file. at the moment the output image is seqeezed so i would like to make it slighlty larger.

this is the coding:

\<?php  
$data = explode(",", $\_POST[‘img’]);  
$width = $\_POST[‘width’];  
$height = $\_POST[‘height’];  
$image=imagecreatetruecolor( $width ,$height );  
$background = imagecolorallocate( $image ,0 , 0 , 0 );  
//Copy pixels  
$i = 0;  
for($x=0; $x\<=$width; $x++)  
{  
for($y=0; $y\<=$height; $y++)  
{  
$int = hexdec($data[$i++]);  
$color = ImageColorAllocate ($image, 0xFF & ($int \>\> 0x10), 0xFF & ($int \>\> 0x8), 0xFF & $int);  
imagesetpixel ( $image , $x , $y , $color );  
}  
}  
//Output image and clean  
header( “Content-type: image/jpeg” );  
ImageJPEG( $image );  
imagedestroy( $image );  
?\>

where would i have to make the neccessary changes?  
cheers
