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.


Which kind of picture to make a correct image

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


Joined: 18 Nov 2005
Posts: 2

PostPosted: Fri Nov 18, 2005 5:54 pm    Post subject: Which kind of picture to make a correct image Reply with quote

Hello !!

I'm testing the Mask Image class, but it's impossible to generate a correct image like I want...

I want to use a gradient file as background image, and a default image as mask. But each time I test my file, php return a message to say that there is error in the picture and it can't display it...

Here is a sample of background gradient image that I want to use, and the code sample :




PHP:
<?
require 'class.imagemask.php';
$im = new imageMask();
$im->setDebugging(true);
$im->maskOption(mdCENTRE);

if (
$im->loadImage(dirname(__FILE__) . "\\gradient.jpg" ) )
{
    
// mask.png is the "blob" sample mask...
    
if ($im->applyMaskdirname(__FILE__) . "\\mask.png" ) ) 
    {
        
//$im->showImage('png');
    
}
}

?>


I have tried with my own mask files (png 8bits) and the blob sample file founded on the Andy's page project, but no good results...

(my php GD version : 2.0.23 Compatible with all options enabled)


So if anybody can test it correctly, tell me how please !! Confused


Thanks in advance


Thierry
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Wed Nov 23, 2005 9:51 am    Post subject: Reply with quote

Hi, and welcome to the board!

I tried this code, but using forward rather than backward slashes as I'm not running on IIS, and it worked just perfectly (I also uncommented to showImage line).

Your mask needs to be 24-bit PNG to get proper masking done, and the images all need to be readable by the class.

When you say you got 'no good results', did you get any result at all or nothing? Did the debugging from the class give any information?

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


Joined: 18 Nov 2005
Posts: 2

PostPosted: Fri Nov 25, 2005 8:20 am    Post subject: Reply with quote

Hi Andy,

Thanks for the reply.

Ok... php returns to me 8bit png info from picture, but my files are 24bits depth colors, so it's right.

(and I'm running on apache)

But no display of picture... I don't know why...

I try to use url to point pictures files, but in this case, I have an error about RealLoadImage, that the path do not point to a readable file.

But If I use full path from disk, no error from your class, but final error on display, because picture contains errors...

If you can and me not, so I don't understand... I have used the blob.png mask and my gradient image file... So why, I don't know...
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 -> 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