Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Forum's topics

Latest Files

Categories

Image Crop

Flash Version: Flash MX
Total downloads: 20947
Category: Flash PHP
File last revision: 07, Oct 2003 08:10:44
License: LGPL

a simple integration of Flash and PHP to build an image cropping tool. Upload your photo, then create a cropping mask under Flash and when you click on save PHP will create a new image based on te cropping mask you created.
Note that this tool requires Flash and PHP with GD libraries installed to work

P.S. before install read the readme.first text document inside the rar file.

 Comments Feed

Do you like this file? Please make a little donation

Flash content

 

Comments (64)

remka2000 on 29th June 2003

FDlash can't handle progressive jpg... So maybe you should write it somewhere...

kim on 17th March 2003

What you people should do again, is look at the ImageMagick module. Heres the sollution for the PHP page loaded when you have completed the flash crop :

CreateCrop("Path to original file", "Path to cropped destination", $x2, $y2, $x1, $y1, "Path to mogrify");
function CreateCrop ($sw_ct_path, $sw_ctt_path, $x1, $y1, $x2, $y2, $mogrifypath) {
@unlink("$sw_ctt_path"); // Remove file and prevent warning
if (!copy($sw_ct_path, $sw_ctt_path)) {
ErrorReport('Could not duplicate the image file for thumbnail creation!');
}
if(CropImage($sw_ctt_path, $x1, $y1, $x2, $y2, $mogrifypath)) { return 1; } else { return 0; }
}
function CropImage ($sw_ri_path, $x1, $y1, $x2, $y2, $mogrifypath, $sharpen=0) {
global $debug;

if($debug){ echo "<br><b>function CropImage</b><br>"; }
$currentimagesize = getimagesize($sw_ri_path);
$image_width = $currentimagesize[0];
$image_height= $currentimagesize[1];

// Need to insert size error checking if crop is larger than the accuall image.

$cmd = "$mogrifypath -crop ".$x1."x".$y1."+".$x2."+".$y2." ".
"$sw_ri_path 2>&1";
if($debug)echo $cmd . "<br>";


exec($cmd, $exec_output, $exec_retval);
if($exec_retval > 0) {
if($debug) { echo "ERROR: exec() error: $exec_output[0]"; }
return 1;
} else {
if($debug){
print "Image was cropped.<br>"; }
return 0;
}

}

alessandro on 16th March 2003

I still use GD 1.6 si I can't help you.. but if you find a way pls tell us

Den on 13th March 2003

My server has GD 2.0 so I changed

imagecopyresized($dst_img, $src_img, 0, 0, $x1, $y1, 100, 100, $x2, $y2)

to

ImageCopyResampled($dst_img, $src_img, 0, 0, $x1, $y1, 100, 100, $x2, $y2)

first one works good but second one always start cropping from top left corner of the source image insted of "x1,y1"

any help?

kim on 17th February 2003

Great tool! Still version 0.1 so can really
complain here, :)

The "Error, images MUST be valid" problem appears
to be in Opera browsers. To fix this
(And get the error in IE instead.. huh..

Open "index.php" and alter line 15 from :
if($img['type'] != "image/pjpeg" || $type != 2)
to
if($img['type'] != "image/jpeg" || $type != 2)

For starters I also wouldnt get the GD thingie to
work on my server, though I have latest GD installed.
In the "imageCrop.php" file however, I solved this
in the variabel :
$ext = "png";
alter to JPG mode
$ext = "jpg";

Remember that you get a download box, since the force
download script is activated here and the cropped image
is downloaded.

However, compared with GD, I think ImageMagick is the
better sollution here to combine, gives a much more
slick result that GD and it opens up alot of more
possibilities.

I take my hat of for you sephiroth!

nacipcrazy on 29th January 2003

sorry about my last comment, my winrar was damaged.

massih2 on 23rd January 2003

this site is very intresting for me

nacipcrazy on 22nd January 2003

the .rar file is wrong

whoever on 27th December 2002

"Error, images MUST be valid jpg"

Tried about 20 images. Get this every time :-(

contacto on 23rd December 2002

You know if this work fine in Mac OS X ?

Add your comment
7bfe98258e14a850eca12c4c4a06664b saved on 19-05-2013 12:29:36 -->