[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    [PHP-WIN] GD problem
From:       213.66.102.5
Date:       2004-08-31 9:04:09
Message-ID: 20040831090231.79798.qmail () pb1 ! pair ! com
[Download RAW message or body]

Hi,

Is it possible to resize jpg/gif from gd 1.7, its working fine in gd 2.0 and
my webbserver wont upgrade.

This is my example (not working in gd 1.7)

<?php

// 1.php

header("Content-type: image/jpeg");

$img = $_GET["img"];

$imgSource = @getimagesize($img);

$imgWidth = $imgSource[0];

$imgHeight = $imgSource[1];

$imgType = $imgSource[2];

switch($imgType) {

case 1: $imgSource = imagecreatefromgif($img); break;

case 2: $imgSource = imagecreatefromjpeg($img); break;

case 3: $imgSource = imagecreatefrompng($img); break;

case 15: $imgSource = imagecreatefromwbmp($img); break;

default: exit;

}

$h = ($_GET["w"]/$imgWidth)*$imgHeight;

$imgTN = @imagecreatetruecolor($_GET["w"], $h);

imagecopyresized($imgTN, $imgSource, 0, 0, 0, 0, $_GET["w"], $h, $imgWidth,
$imgHeight);

imagejpeg($imgTN, null, 80);

imagedestroy($imgTN);

?>

<img src="1.php?img=1.jpg&w=70&q=70">

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic