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.


error: Cannot redeclare class canvascrop

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


Joined: 24 Mar 2004
Posts: 5

PostPosted: Wed Mar 24, 2004 9:16 am    Post subject: error: Cannot redeclare class canvascrop Reply with quote

Fatal error: Cannot redeclare class canvascrop in /Users/sd1/Sites/vipic/salat/admin/class.cropcanvas.php on line 77


what could be the problem?

i'm on MAC OS X, apache 2 and php 4.3.4

best wishes,
shai
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 Mar 24, 2004 1:32 pm    Post subject: Reply with quote

Hi shai, and welcome to the board!

That error basically says that you are trying to 'require' (or 'include') the class file in more than one place in the same script (or within included files called by your main script).

Try using 'require_once' or 'include_once', which will make PHP effectively ignore subsequent declarations of the class.

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


Joined: 24 Mar 2004
Posts: 5

PostPosted: Wed Mar 24, 2004 3:09 pm    Post subject: Reply with quote

hi!
10x a lot for your fast answer. i'll try that and i hope it will solve my problem.

shai
Back to top
View user's profile Send private message
sd1
Newbie


Joined: 24 Mar 2004
Posts: 5

PostPosted: Wed Mar 24, 2004 4:03 pm    Post subject: Reply with quote

ok!!! now the error message was gone.

but, i still can't get the files to work

my code:
Code:

require_once 'class.cropcanavas.php';
$cc = new canavasCrop();

if ($cc -> loadImage ('newGalleries/temps/$photoimage'))
{

$cc -> cropBySize('75','75', ccTop);
$cc -> saveImage ('newGalleries/thumbs/$time_$newName');
$cc -> flushImages();
}



i guess that i'm missing something

can you please tell me what is it?

best wishes
Shai
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 Mar 24, 2004 5:48 pm    Post subject: Reply with quote

Hi,

Try turning on debugging and see what it tells you. Do this by passing 'true' as a parameter when you create an instance of the class:

Code:
$cc = new canavasCrop(true);


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


Joined: 24 Mar 2004
Posts: 5

PostPosted: Thu Mar 25, 2004 4:21 am    Post subject: Reply with quote

Hi again, and again - thanks for your help.

i get this error message: Error in function saveImage: '. That file cannot be saved with the function 'image
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 Mar 25, 2004 4:37 am    Post subject: Reply with quote

sd1 wrote:
i get this error message: Error in function saveImage: '. That file cannot be saved with the function 'image


The 'saveImage' function tries to auto-determine the extension of your file and then load the correct image saving function based on it. The error message you are getting would indicate that you don't have an extension on the end of your file name.

Either put a '.jpg' or '.png' on the end of the name, or make sure the '$newName' variable includes the extension.

Code:
$cc -> saveImage ("newGalleries/thumbs/{$time}_{$newName}.jpg");


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


Joined: 24 Mar 2004
Posts: 5

PostPosted: Thu Mar 25, 2004 4:55 am    Post subject: Reply with quote

thanks a lot
now it seems to work

Shai
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