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.


Example does nothing :roll:

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


Joined: 08 Jan 2004
Posts: 7

PostPosted: Thu Jan 08, 2004 8:36 am    Post subject: Example does nothing :roll: Reply with quote

I downloaded all the classes + examples, to test it on my server. Debian Woody with php GD.
The interactive interface works perfect on Safari (osX) but when I do a CROP it return's nothing...
Where in the example the cropped image should be, I get an blank page ...
A little hint would help me Smile
gr Kleinejan
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 Jan 08, 2004 9:28 am    Post subject: Re: Example does nothing :roll: Reply with quote

kleinejan wrote:
I downloaded all the classes + examples, to test it on my server. Debian Woody with php GD.
The interactive interface works perfect on Safari (osX) but when I do a CROP it return's nothing...
Where in the example the cropped image should be, I get an blank page ...
A little hint would help me Smile
gr Kleinejan


Hi there, and welcome to the board! Smile

Okay, this has to be quick because I have a meeting to go to... Try saving the cropped image rather than displaying it. Does it save at all? Other things that may help to diagnose: what version of PHP and GD are you using and have you tried debugging on? (initialize the class with 'true' as a parameter - no quotes.)

Anyway, gotta split.. boss is calling! Let me know your outcome and I'll try to helplater.

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


Joined: 08 Jan 2004
Posts: 7

PostPosted: Thu Jan 08, 2004 11:03 am    Post subject: Re: Example does nothing :roll: Reply with quote

GD version 1.6.2
PHP4 version 4.1.2
Euhmm...how do I enable debugging, tried to mess around but .. Sad
Thankz for the QUICK reaction Smile
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 Jan 08, 2004 11:19 am    Post subject: Re: Example does nothing :roll: Reply with quote

kleinejan wrote:
GD version 1.6.2
PHP4 version 4.1.2
Euhmm...how do I enable debugging, tried to mess around but .. Sad


Hmm.. It should work with that, though your image quality would be MUCH better it you could upgrade to a newer version of GD.

I say 'should' work, but I tested it with version 4.3.3 and 4.3.4... I could try to get 4.1.2 installed and see if that throws anything back. In what version of PHP did the super globals $_GET/$_POST come into things? That might be affecting the example...

To enable debugging (which is just some simple text output, really, but could help), you would initialize the class like:

$ci = new cropInterface(true);

So an example of use would be:

PHP:
<?php

  
require_once 'class.cropinterface.php';
  
$ci = new cropInterface(true);
  if (
$HTTP_GET_VARS['file']) {
    
$ci->loadImage($HTTP_GET_VARS['file']);
    
$ci->cropToDimensions($HTTP_GET_VARS['sx'], $HTTP_GET_VARS['sy'], $HTTP_GET_VARS['ex'], $HTTP_GET_VARS['ey']);
    
header('Content-type: image/jpeg');
    
$ci->showImage('jpg'100);
    exit;
  } else {
    
$ci->loadInterface('myfile.jpg');
    
$ci->loadJavaScript();
  }

?>


Notice that I changed $_GET for $HTTP_GET_VARS. If the debugging returns nothing, then either remove the 'true' you put in, or change it to 'false'.

kleinejan wrote:
Thankz for the QUICK reaction Smile


I try. Wink

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


Joined: 08 Jan 2004
Posts: 7

PostPosted: Fri Jan 09, 2004 4:52 am    Post subject: Re: Example does nothing :roll: Reply with quote

instead of _GET/_POST you also can use _REQUEST it catches all.
The debug does not return anything, which is also weird.
R/WR permissions are 777 (just to be sure that that isn't the problem)
I will play around with it and try to install a backport for php in woody.
Keep you all posted
Smile
Back to top
View user's profile Send private message
kleinejan
Newbie


Joined: 08 Jan 2004
Posts: 7

PostPosted: Fri Jan 09, 2004 6:04 am    Post subject: Reply with quote

okay okay.
just saw that there's a php-gd and php-gd2!!
Me so stupid Smile
Me so happy it works now Smile
time for a beer
gr kleinejan!
Back to top
View user's profile Send private message
diversive
Newbie


Joined: 04 Mar 2004
Posts: 2

PostPosted: Fri Mar 05, 2004 10:25 am    Post subject: GD Bug? Reply with quote

I found that on my web host which has GD1.x installed, the GD was not detecting correctly...

I've done a bodge job to force it not to use the GD2 function (which it thinks it's detected) by commenting out the lines:

PHP:
<?php if ($this->_gdVersion == 2)
        {
          
/*
            $this->_imgFinal = @ImageCreateTrueColor($nx, $ny);
            @ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, $ox, $oy, $nx, $ny, $nx, $ny); */

            
$this->_imgFinal = @ImageCreate($nx$ny);
            @
ImageCopyResized($this->_imgFinal$this->_imgOrig00$ox$oy$nx$ny$nx$ny);
        }
        else
        {

            
$this->_imgFinal = @ImageCreate($nx$ny);
            @
ImageCopyResized($this->_imgFinal$this->_imgOrig00$ox$oy$nx$ny$nx$ny);
        } 
?>


Hope this helps anyone. I wonder why it doesn't return the GD version properly though ?
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 Mar 05, 2004 11:44 am    Post subject: Re: GD Bug? Reply with quote

diversive wrote:
I found that on my web host which has GD1.x installed, the GD was not detecting correctly...

I've done a bodge job to force it not to use the GD2 function (which it thinks it's detected) by commenting out the lines...


Hi there,

Another way to do it would be to use the class method _getGDVersion(). You'd do this in the class constructor, so that the line:

Code:
$this->_gdVersion = (function_exists('imagecreatetruecolor')) ? 2 : 1;


will look like:

Code:
$this->_gdVersion = $this->_getGDVersion();


Regards,

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