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.


Newbie Problem with Crop Box

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


Joined: 06 Aug 2004
Posts: 2

PostPosted: Fri Aug 06, 2004 10:47 am    Post subject: Newbie Problem with Crop Box Reply with quote

First and foremost, I like this script and my problem is probably my fault. Anyways, here it goes. When I load the page calling the classes, I get the following error on load:

Error: 'MAXOFFLEFT' is underfined

Once I try to click the "Crop the image" button, the error changes to:

Error: 'dd' is underfined

Note: The yellow cropping boxes is in the upper-left corner and won't move nor resize.

My test page looks like this and is a php file and runs on a server with php:

PHP:
<?php <html>
<
head>
<
title></title>
</
head>
<
body>
<?
php 

  
require_once 'imgmanipulator/cropcanvas/class.cropinterface.php'
  
$ci = new cropInterface(); 
  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); 
    exit; 
    } 
  else { 
    
$ci->setResizing(true);     
    
$ci->loadInterface('tonya&evan.jpg'); 
    
$ci->loadJavaScript(true); 
    } 

?>
</body>
</html> ?>


The test page is in the root directory and all the classes are within two directory, hence the:

PHP:
<?php require_once 'imgmanipulator/cropcanvas/class.cropinterface.php'?>


I'm wondering if I have to change some paths in these class files some where?

I search through the other topics here, but didn't find anything similar to this explained.

Any help is appreciated.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Fri Aug 06, 2004 11:12 am    Post subject: Reply with quote

Hi, and welcome to the board!

It seems to me like the class cannot locate the wz_dragdrop.js file. Make sure is in the same directory where you're running the script from. Or, if yo uwant it where the class is (which really it would be better to do, so I should update the class), update this line:

echo '<script type="text/javascript" src="wz_dragdrop.js"></script>', "\n";

to look like:

echo '<script type="text/javascript" src="', dirname(__FILE__), '/wz_dragdrop.js"></script>', "\n";

Try it out and see what that does for you. Smile

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


Joined: 06 Aug 2004
Posts: 2

PostPosted: Fri Aug 06, 2004 11:52 am    Post subject: Reply with quote

Um, it's still not fixed. Still the same error.

EDIT: If I change that line to the absolute path ie.

PHP:
<?php echo '<script type="text/javascript" src="http://www.*******.ca/administrator/imgmanipulator/cropcanvas/wz_dragdrop.js"></script>'"\n"?>


I don't get any errors, however now the image doesn't show and the crop box moves all choppy and just pivots in the upper-left corner as I'm trying to drag it.

With this in:

PHP:
<?php echo '<script type="text/javascript" src="'dirname(__FILE__), '/wz_dragdrop.js"></script>'"\n"?>


I still get the same error as earlier and if I echo out dirname(__FILE__), I get the correct path that the js and all the other classes are located in.
Back to top
View user's profile Send private message
kakashi
Newbie


Joined: 09 Aug 2004
Posts: 2

PostPosted: Thu Aug 12, 2004 6:11 pm    Post subject: Reply with quote

Quote:
<?echo '<script type="text/javascript" src="', dirname(__FILE__), '/wz_dragdrop.js"></script>', "\n";

I fix my error MAXOFFLEFT with it. Thanks !!!
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