Jump to content

Image cropping script - need help


Harley1979

Recommended Posts

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:

 

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

Link to comment
https://forums.phpfreaks.com/topic/118687-image-cropping-script-need-help/
Share on other sites

Yeah I know what you mean about using premade scripts, not something I'm in the habbit of doing but i really need this functionality on a site I'm doing really badly.

 

I'm not sure where my fall down is here, it may be that I don't know enough about creating images with php or just that I am hopeless with objects, properties and methods as that is what this script heavily uses.

 

If anyone else has any ideas please let me know.

 

Thanks

 

Harley

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.