Image cropping script - need help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Harley1979
Forum Newbie
Posts: 1
Joined: Thu Aug 07, 2008 4:22 pm

Image cropping script - need help

Post by Harley1979 »

Hello,

I am using a nice little script I came across to crop images (here are the files: http://php.amnuts.com/index.php?do=view&id=12 - Demo: http://php.amnuts.com/demos/crop-canvas/interactive.php)

I now have it working ok, on the final stage it is writing the image out to the screen in the code here:

Code: Select all

require('class.cropinterface.php');
$ci =& new CropInterface(true);
 
if (isset($_GET['file'])) {
    $ci->loadImage($_GET['file']);
    $ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
    $ci->showImage('png', 100);
 
    exit;
}
My question is how do I make this image a jpg file and save to a directory? I've only done simple file upload scripts before now and don't have much of an idea how this is gonna work.

Any help is much appreciated.

Thanks

Harley
Post Reply