本文整理汇总了PHP中SimpleImage::load_data方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleImage::load_data方法的具体用法?PHP SimpleImage::load_data怎么用?PHP SimpleImage::load_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::load_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
$file = PRODUCT_IMAGE_PATH . 'img' . PRODUCT_IMAGE_SIZE . '-' . $image_id . '.png';
if (!file_exists(FILE_PATH . $file)) {
// If the image does not exist, then get it from the database
$query = '
SELECT
*
FROM
' . TABLE_PRODUCT_IMAGES . '
WHERE
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__));