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.


syntax error

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


Joined: 02 Apr 2007
Posts: 2
Location: Sugar Land, TX USA

PostPosted: Mon Apr 02, 2007 5:48 pm    Post subject: syntax error Reply with quote

I love the script, exactly what I needed!

Quote:
Parse error: syntax error, unexpected '{' in /home/family/public_html/myplace/index.php on line 32


Code:
<?php
    require 'class.imagemask.php';
    $im = new imageMask('ffffff');
    $im->maskOption(mdCENTRE);
    if ($im->loadImage("http://webtoastmedia.com/uploads/image.jpg")
    {
        if ($im->applyMask(dirname(__FILE__) . "/images/block.png"))
        {
            $im->showImage('png');
        }
    }   
?>


I am wanting to apply the mask dynamically to a couple of images on one of my pages. The images are already uploaded and sized perfectly. I just need the little border thing that you so smartly created! Please help...
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: Tue Apr 03, 2007 1:44 am    Post subject: Reply with quote

Hi, and welcome to the board!

I'm glad you like the code!

The error message mentions line 32, but the code you posted doesn't have anywhere near that number of lines. If you look at your code around about the line 32 mark then you might be able to see your problem.

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


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

PostPosted: Tue Apr 03, 2007 12:40 pm    Post subject: Reply with quote

I didn't see it before, but as I just emailed you, the error is here:

Code:
if ($im->loadImage("http://webtoastmedia.com/uploads/image.jpg")


Make it:

Code:
if ($im->loadImage("http://webtoastmedia.com/uploads/image.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
imadork
Newbie


Joined: 02 Apr 2007
Posts: 2
Location: Sugar Land, TX USA

PostPosted: Tue Apr 03, 2007 3:37 pm    Post subject: cool... Reply with quote

Yes, thank you. that helped! Now, I am wanting to show that image on a page. How can I call that image on another page dynamically? --never mind I got that....

The only problem I have left is the mask is doing the opposite as desired. The black part is white and the white part is the image.

See example:

http://homestead.cffamily.org/ad1.php
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 Apr 04, 2007 7:32 am    Post subject: Reply with quote

No, that's correct. If you check out the default demo:

http://php.amnuts.com/demos/image-mask/

You'll notice that what's white shows the image and what's black shows the background colour. Just invert your mask image and that should sort you out.

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