本文整理匯總了PHP中SimpleImage::resizeDownToWidthHeight方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleImage::resizeDownToWidthHeight方法的具體用法?PHP SimpleImage::resizeDownToWidthHeight怎麽用?PHP SimpleImage::resizeDownToWidthHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::resizeDownToWidthHeight方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
image_id = "' . $image_id . '"';
$result = @mysql_query($query, $connection) or die(debug_print("ERROR: 785922 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
$row = mysql_fetch_array($result);
// Use SimpleImage (from image_functions.php) to resize the image
// and save it to the expected file
$image = new SimpleImage();
$image->load_data($row['image_content']);
// If we don't have a width or height for this image in the
// database, then save it now.
if ($row['width'] == 0 || $row['height'] == 0) {
$image_info = getimagesizefromstring($row['image_content']);
$original_width = $image_info[0];
$original_height = $image_info[1];
$query = '
UPDATE
' . TABLE_PRODUCT_IMAGES . '
SET
width = "' . $original_width . '",
height = "' . $original_height . '"
WHERE
image_id = "' . mysql_real_escape_string($_GET['image_id']) . '"';
$result = @mysql_query($query, $connection) or die(debug_print("ERROR: 902742 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
}
$image->resizeDownToWidthHeight(PRODUCT_IMAGE_SIZE);
$image->save(FILE_PATH . $file, IMAGETYPE_PNG);
// This would be a good place to remove any of the same image but of a different size
// NOT IMPLEMENTED
}
// Now redirect the browser to the actual image
header('Location: ' . $file, TRUE, 301);
}