Hi,
The script below functioned correctly, but I guess my host updated php and now I've got a problem using PHP/ImageCreateFromJPEG(), it looks like this function now returns a 16 color image instead of the fullcolor original.
Does this sound formilior (?? excuse my english)
See these links for an example
Original image: http://www.achterdeheuvel.nl/foto/2002/week1/2002_1_081.jpg
With script: http://www.achterdeheuvel.nl/resize.php?dir=foto/2002/week1&pic=2002_1_081&w=610&h=407
========================================
== PHP Script used
<?php
/*
Script for image rescaling, version 1.0
(C) Z. Wagner -- Ice Bear Soft, 2002
[url]http://icebearsoft.euweb.cz[/url]
The script was prepared for photo galleries at
[url]http://icebearsoft.euweb.cz/photo.html[/url]
This PHP script is free software. Its use and distribution should follow
the General Public Licence (see [url]http://www.gnu.org[/url]). Since this licence
is void in the Czech Republic, the users may opt to use a modified version
available from [url]http://www.zastudena.cz[/url]
You can find more information on [url]http://icebearsoft.euweb.cz/czgpl/[/url]
*/
if (!$dir || !$pic || !$w || !$h) die();
if (!preg_match('/\d+/', $w)) die();
if (!preg_match('/\d+/', $h)) die();
if ($h < 10 || $w < 10) die();
header('Content-Type: image/jpeg');
if ($REQUEST_METHOD != 'GET') exit;
$src = ImageCreateFromJPEG("$dir/$pic.jpg");
if ($src) {
$size = GetImageSize("$dir/$pic.jpg");
$img = ImageCreate($w, $h);
ImageCopyResized($img, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]);
ImageJPEG($img);
}
?>