This simple resize script has been working for a long time.
The images are created on the fly and then passed back to a calling Perl script.
I need to save some images in another app. so I adapted this to save the image, substituted the red section for the green section.
No errors but the image is just not saving, can anyone suggest any reason for this?
Keith
The images are created on the fly and then passed back to a calling Perl script.
I need to save some images in another app. so I adapted this to save the image, substituted the red section for the green section.
No errors but the image is just not saving, can anyone suggest any reason for this?
Code:
<?php
$img_name=$_GET['imnam'];
$new_width=$_GET['maxwid'];
$new_height=$_GET['maxhi'];
$simg_name="../xxxxx/xxxxx/"."$img_name";
$sav_name="[URL unfurl="true"]http://www.xxxxxxx.xxxxx/xxxxx/"."$img_name";[/URL]
$size=GetImageSize($simg_name);
$bwimage = ImageCreateFromJPEG($simg_name);
$thumb = ImageCreateTrueColor($new_width,$new_height);
ImageCopyResampled($thumb, $bwimage, 0,0,0,0,$new_width,$new_height,$size[0],$size[1]);
// [red]imagejpeg($thumb) ;[/red]
[green]imagejpeg($thumb, $sav_name, 100) ;[/green]
ImageDestroy($bwimage);
?>
Keith