andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


help please - crop|save|resize

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
silverno
Newbie


Joined: 11 May 2005
Posts: 2

PostPosted: Wed May 11, 2005 2:43 pm    Post subject: help please - crop|save|resize Reply with quote

hello andy,

first off all, thanks for your awesome crop script. exactly what i was looking for!

after playing around with your script for about two hours, i kindly ask you for help.
i wanna do an image crop with fixed dimensions (i. e. starting with 73x78px) and the cropping area should resize proportional to this values. after cropping the image sould be saved with dimensions 73x78px (althought it will be 217x231px or something).

that's what i've got for now:

1) cropping area starts with 73x78px
(but i have to click 'proportional' each time i resize -> easier way possible? can i set a default value?)
2) save the cropped image
3) i tried to use the 'redim' class to resize the image afterwards to my prefered 73x78px ... but won't work.

any suggestions?
very thanks in advance!


PHP:
<?php require_once('class.cropcanvas.php');
    require_once 
'class.cropinterface.php';
    
$ci = new cropInterface();
    
$ci->setCropDefaultSize(7378);
    
    if (
$_GET['file'])
    {
        
$ci->loadImage($_GET['file']);
        
$ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
        
header('Content-type: image/jpeg');
        
$ci->showImage('jpg'100);
        
$ci->saveImage('final1.jpg');
        
        require_once(
'class.redim.php');
        
$rd = new imgRedim(); 
        
$rd->loadImage('final1.jpg'); 
        
$rd->redimToSize(7380true); 
        
$rd->saveImage('final.jpg'90);
        exit;
    } 
?>
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Mon May 16, 2005 9:22 am    Post subject: Reply with quote

Hi, and welcome to the board.

I've just posted up an answer asking pretty much the same question. Here's the link:

http://php.amnuts.com/forums/viewtopic.php?p=1045#1045

As to the default cropping size, see this link:

http://php.amnuts.com/forums/viewtopic.php?t=196

and set to proportional only resizing:

http://php.amnuts.com/forums/viewtopic.php?t=184

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
silverno
Newbie


Joined: 11 May 2005
Posts: 2

PostPosted: Thu May 19, 2005 12:38 pm    Post subject: alright ;-) Reply with quote

hi andy,
works perfectly, very thanks for you help!

best regards.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group