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.


Nothing works

 
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
datecpro
Newbie


Joined: 06 Aug 2004
Posts: 4

PostPosted: Wed Aug 18, 2004 4:07 am    Post subject: Nothing works Reply with quote

Nothing happen when i run this script. No new picture is created in the new folder. No failure is shown from the script.

What is wrong?
I only wanted to reseize an image to 50% of the original size.
here is the code :


Code:

$username = xxx;
$fext = ".jpg";
$newpicname = $username."_".$newpicid.$fext;
$uploaddir = 'imgdb_large/';
$thumbdir ='imgdb_small/';
require 'class/class.cropcanvas.php';
$cc = new canvasCrop();

if ($cc->loadImage($uploaddir.$newpicname))
    {
      $cc->cropByPercent(50, 50, ccCENTER);
      $cc->saveImage($thumbdir.$newpicname, 90);
      $cc->flushImages();
    }

Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Wed Aug 18, 2004 6:16 am    Post subject: Re: Nothing works Reply with quote

datecpro wrote:
I only wanted to reseize an image to 50% of the original size.


If you're wanting to resize, then cropcanvas is the wrong class to use. Resizing an image - eg, making a thumbnail version of a bigger image - would take this class: class.dropshadow.php (don't let the name fool you. It's actually a rather powerful image resizing with a bit of a drop-shadow capability thrown in for good measure.) The crop canvas class will remove (delete, cut off, chop, crop, cut.. however you want to term it) bits of an image while still retaining the image in the same pixel ratio.

But anyway, if you want to turn on debugging, which would be the first step, the instantiate the class with 'true' passed as a parameter. Such as:

Code:
require 'class/class.cropcanvas.php';
$cc = new canvasCrop(true);


Once you do that (and the same goes for the drop shadow class, too, by the way), it'll give errors. In this instance it doesn't seem able to load the image (in this case 'xxx_.jpg'). Check the file name is valid, and you might also want to give it the full path to the file (and, naturally, check that you have read/write permissions for the area and file.)

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


Joined: 06 Aug 2004
Posts: 4

PostPosted: Thu Aug 19, 2004 3:09 am    Post subject: Nice to have it Reply with quote

My scripts works fine now. I changed to dropshadow.class. What i as a newbie to your script is missing on your page is an help file to every class where you show all the functions that are possible with the class.

Something like this :

$ds->loadImage(PICTURENAME)
$ds->resizeByPercent(x,y);
x=???
y=???

Would be very nice to have it. That everybody who is new to this script can see how powerfull the script is.

Thanks for helping.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Thu Aug 19, 2004 3:35 am    Post subject: Reply with quote

Thanks for the feedback. I have plans to revamp the website, which would be the perfect time to add more helpfiles for the classes. Not sure when that will happen yet (lots on my plate right now), but I'll certainly bear it in mind when I get to do it.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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