The differnce seems rather large; when I did some tests a couple of years ago the file size of IM was about 5x the size of GD.
It would be interesting to see your actual code used.
我当时正在工作,但照片重为592×592,档案50.3KB,我知道其大小与你的大小不相同,但质量为100。
You can run this and see what IM says about the output files:
convert image -verbose -identify
EDIT:
你们必须做一些错误的事情,我刚刚进行了试验,结果低于——因为某种原因,th的大小与 res的面积相同! 也许会 a。
原始档案尺寸:4700×3178 2.31MB
- 面积=1021×680 186kb
- th
GD尺寸=1024×682 100kb
$original = IMG_4979_1.CR2 ;
// Convert to jpg as GD will not work with CR2 files
exec("convert $original image.jpg");
$image = "image.jpg";
exec("convert $image -resize 1024x680 output1.jpg");
exec("convert $image -thumbnail 1024x680 -strip output2.jpg");
// Set the path to the image to resize
$input_image = image.jpg ;
// Get the size of the original image into an array
$size = getimagesize( $input_image );
// Set the new width of the image
$thumb_width = "1024";
// Calculate the height of the new image to keep the aspect ratio
$thumb_height = ( int )(( $thumb_width/$size[0] )*$size[1] );
// Create a new true color image in the memory
$thumbnail = ImageCreateTrueColor( $thumb_width, $thumb_height );
// Create a new image from file
$src_img = ImageCreateFromJPEG( $input_image );
// Create the resized image
ImageCopyResampled( $thumbnail, $src_img, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1] );
// Save the image as resized.jpg
ImageJPEG( $thumbnail, "output3.jpg" );
// Clear the memory of the tempory image
ImageDestroy( $thumbnail );