Page 1 of 1

php jpeg/png support

PostPosted: 23. September 2014 16:28
by cfranks
How do i recompile the php with the jpeg and png support.

Re: php jpeg/png support

PostPosted: 24. September 2014 21:17
by iskono
this might help i guess
source :
http://php.net/manual/en/book.image.php
Code: Select all
<?php
// Create a test source image for this example
$im = imagecreatetruecolor(300, 50);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);

// start buffering
ob_start();
// output jpeg (or any other chosen) format & quality
imagejpeg($im, NULL, 85);
// capture output to string
$contents = ob_get_contents();
// end capture
ob_end_clean();

// be tidy; free up memory
imagedestroy($im);

// lastly (for the example) we are writing the string to a file
$fh = fopen("./temp/img.jpg", "a+" );
    fwrite( $fh, $contents );
fclose( $fh );
?>

Re: php jpeg/png support

PostPosted: 24. September 2014 22:54
by cmb69
cfranks wrote:How do i recompile the php with the jpeg and png support.

No need to recompile PHP when you're using XAMPP 1.8.3-5 on Windows. JPEG and PNG support is already enabled for the GD extension.