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.


cropcanvas does not work :-(

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


Joined: 04 Jan 2005
Posts: 2

PostPosted: Tue Jan 04, 2005 7:12 pm    Post subject: cropcanvas does not work :-( Reply with quote

Hi,

Great script! if I also could make it to work Smile

cropcanvas gives me problems. For some reason cropped images do not apear - or, sometimes, lines of weird code apears instead of the image. Here is a sample code I use:

Code:

<?php
    require 'class.cropcanvas.php';
    $cc = new canvasCrop();

    if ($cc->loadImage('image.png'))
    {
     $cc->cropByPercent(15, 50, ccCENTER);
       $cc->showImage('myimage.png');
    }
?>


Any suggestions? :-/
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Wed Jan 05, 2005 7:17 am    Post subject: Reply with quote

Hi, and welcome to the board!

Try setting the correct header for the image, such as:

PHP:
<?php

    
require 'class.cropcanvas.php';
    
$cc = new canvasCrop();

    if (
$cc->loadImage('image.png')) {
        
$cc->cropByPercent(1550ccCENTER);
        
header('Content-type: image/png');
        
$cc->showImage('myimage.png');
    }

?>


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


Joined: 04 Jan 2005
Posts: 2

PostPosted: Wed Jan 05, 2005 8:01 am    Post subject: Reply with quote

Hi, thnx for your reply (and a happy new year to you all)

I had tryed this, late in the night yesterday, before I sent you the question but it did not work (there was a header output error). This morning, and after a good sleep, I realized that I had left a blank line on the top of the cropcanvas class which resulted into the error Embarassed . Now it works. Cheers Wink



amnuts wrote:
Hi, and welcome to the board!

Try setting the correct header for the image, such as:

PHP:
<?php

    
require 'class.cropcanvas.php';
    
$cc = new canvasCrop();

    if (
$cc->loadImage('image.png')) {
        
$cc->cropByPercent(1550ccCENTER);
        
header('Content-type: image/png');
        
$cc->showImage('myimage.png');
    }

?>


andy
Back to top
View user's profile Send private message Visit poster's website
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