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.


Please can you help me?

 
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 -> Image Mask
View previous topic :: View next topic  
Author Message
JaneC
Newbie


Joined: 01 Sep 2005
Posts: 1

PostPosted: Thu Sep 01, 2005 9:35 am    Post subject: Please can you help me? Reply with quote

Hello everyone. I am very new to PHP and am really enjoying it. I have never seen anything like tghis script and am very impressed. I downloaded the code but I really don't have a clue how to implament it. Please can someone post some sample code that I can understand that show who to use this code fully?

I greated a file called test.php and has the follwoing code but it outputs nothing:
Code:
<?
require 'class.imagemask.php';
$im = new imageMask('ffffff');
$im->maskOption(mdCENTRE);
if ($im->loadImage(dirname(__FILE__) . "16.jpg"))
{
    if ($im->applyMask(dirname(__FILE__) . "demomask-frame1.png"))
    {
        $im->showImage('png');
    }
}
?>
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Mon Sep 05, 2005 11:21 am    Post subject: Re: Please can you help me? Reply with quote

Hi, and welcome to the board!

Using it depends on just what you want to do with it, unfortunately. I use it quite often in a script which just processes a directory of images, while others use it to display a mask on the fly, while others might use it to process an image they upload.

You have a slight bug in your code... This line:

Code:
if ($im->loadImage(dirname(__FILE__) . "16.jpg"))


needs to be:

Code:
if ($im->loadImage(dirname(__FILE__) . "/16.jpg"))


and:

Code:
if ($im->applyMask(dirname(__FILE__) . "demomask-frame1.png"))


needs to be:


Code:
if ($im->applyMask(dirname(__FILE__) . "/demomask-frame1.png"))


(Maybe they are already - the post might have just stripped the slashes.)

The images '16.jpg' and 'demomask-frame1.png' need to be in the same directory as the script and readable by the script.

Finally, if it doesn't work then try turning on debugging. You can do this with the method call:

Code:
$im->setDebugging(true);


after you instantiate the object (the $im = new... line).

This might tell you reasons why the image is not being displayed.

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 -> Image Mask 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