function make_thumb($src,$dest,$desired_width) { $img = new Zubrag_image; // initialize $img->max_y = $desired_width; // generate thumbnail $img->GenerateThumbFile($src, $dest); }
$ni = ImageCreateTrueColor($this->max_x, $this->max_y); } // Fill image with white background (255,255,255) $white = imagecolorallocate($ni, 255, 255, 255); imagefilledrectangle($ni, 0, 0, $this->max_x, $this->max_y, $white); // Create a new image from source file $im = $this->ImageCreateFromType($orig_img_type, $from_name); // Copy the palette from one image to another imagepalettecopy($ni, $im); // Copy and resize part of an image with resampling imagecopyresampled($ni, $im, 0, 0, 0, 0, $this->max_x, $this->max_y, $orig_x, $orig_y); // srcW, srcH // save thumb file $this->SaveImage($ni, $to_name); if ($temp) { unlink($tmpfname); // this removes the file } } } $img = new Zubrag_image(); // initialize $img->max_x = $max_x; $img->max_y = $max_y; $img->cut_x = $cut_x; $img->cut_y = $cut_y; $img->quality = $image_quality; $img->save_to_file = $save_to_file; $img->image_type = $image_type; // generate thumbnail $img->GenerateThumbFile($images_folder . $from_name, $thumbs_folder . $to_name);
<? include('plugin.gallery.upload.php'); $img = new Zubrag_image; // initialize $img->max_x = 150; // generate thumbnail $img->GenerateThumbFile('./../../media/images/testbild.jpg', './../../media/images/thumb_testbild.jpg'); ?>
public function createThumbs($from_name, $to_name, $max_x, $max_y) { ini_set('memory_limit', '-1'); // include image processing code include 'image.class.php'; $img = new Zubrag_image(); // initialize $img->max_x = $max_x; $img->max_y = $max_y; $img->cut_x = 0; $img->cut_y = 0; $img->quality = 100; $img->save_to_file = true; $img->image_type = -1; $img->GenerateThumbFile($from_name, $to_name); }
// | This script may not be distributed, sold, given away for free to | // | third party, or used as a part of any internet services such as | // | webdesign etc. | // +----------------------------------------------------------------------+ include "../includes/config.php"; include "../includes/session.php"; include "../includes/functions.php"; include '../includes/image.class.php'; if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } $maximagesizestringinPHP = ini_get("upload_max_filesize"); $maximagesizeinPHP = $maximagesizestringinPHP * (1024 * 1024); $img = new Zubrag_image(); if (isset($_SESSION["sess_adminname"]) and $_SESSION["sess_adminname"] != "") { $adminname = $_SESSION["sess_adminname"]; } else { header("Location:login.php"); exit; } if (isset($_GET["artistid"]) and $_GET["artistid"] != "") { $artistid = $_GET["artistid"]; } else { if (isset($_POST["artistid"]) and $_POST["artistid"] != "") { $artistid = $_POST["artistid"]; } } if (isset($_REQUEST["mybusinessid"]) && $_REQUEST["mybusinessid"] != "") { $mybusinessid = $_REQUEST["mybusinessid"];
// | This source file is a part of iScripts Multicart | // +----------------------------------------------------------------------+ // | Authors: Programmer<*****@*****.**> | // +----------------------------------------------------------------------+ // | Copyrights Armia Systems, Inc and iScripts.com � 2005 | // | All rights reserved | // +----------------------------------------------------------------------+ // | This script may not be distributed, sold, given away for free to | // | third party, or used as a part of any internet services such as | // | webdesign etc. | // +----------------------------------------------------------------------+ include "../includes/config.php"; include "../includes/session.php"; include "../includes/functions.php"; include '../includes/image.class.php'; $img = new Zubrag_image(); if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } if (isset($_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"] != "") { $artistid = $_SESSION["sess_artistid"]; } else { header("Location:login.php"); exit; } if (isset($_POST["portfolioid"]) and $_POST["portfolioid"] != "") { $portfolioid = $_POST["portfolioid"]; } $txtArtistDescription = trim($_POST["txtArtistDescription"]);
$max_x = intval($_REQUEST['x']); } if (isset($_REQUEST['y'])) { $max_y = intval($_REQUEST['y']); } $full_path = $images_folder . $from_name; if (!file_exists($images_folder)) { die('Images folder does not exist (update $images_folder in the script)'); } if ($save_to_file && !file_exists($thumbs_folder)) { die('Thumbnails folder does not exist (update $thumbs_folder in the script)'); } if (!file_exists($full_path)) { $from_name = 'blank-person.png'; } // Allocate all necessary memory for the image. // Special thanks to Alecos for providing the code. ini_set('memory_limit', '-1'); // include image processing code include 'image.class.php'; $img = new Zubrag_image(); // initialize $img->max_x = $max_x; $img->max_y = $max_y; $img->cut_x = $cut_x; $img->cut_y = $cut_y; $img->quality = $image_quality; $img->save_to_file = $save_to_file; $img->image_type = $image_type; // generate thumbnail $img->GenerateThumbFile($images_folder . $from_name, '');