Hi,
I've got a script that uses GD to take a pdf and resize and resample it to a .jpg;
Thing is though the images appear very grainy when they are converted. I've tried imagecopyresampled on this line:PHP Code:<?php
$result1=exec("convert test.pdf[0] test.jpg");
$file="test.jpg";
$size = GetImageSize ("$file");
$height=350;
$width=floor($size[0]/($size[1]/$height));
$im = ImageCreateFromJPEG ($file);
$im2= ImageCreate ($width, $height);
$width2=$size[0];
$height2=$size[1];
imagecopyresized ($im2, $im, 0, 0, 0, 0, $width, $height, $width2, $height2);
$file3=substr("$file", 0,-4)."_small.jpg";
imagejpeg ($im2, $file3, 100);
unlink ($file);
$newsize=GetImageSize ($file3);
?>
But that still makes the image appear grainy as well?PHP Code:imagecopyresampled ($im2, $im, 0, 0, 0, 0, $width, $height, $width2, $height2);
Can anone help?






Bookmarks