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.


How save in directory? :?:

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


Joined: 20 Mar 2007
Posts: 1

PostPosted: Tue Mar 20, 2007 10:07 pm    Post subject: How save in directory? :?: Reply with quote

Hi,

First I want tell Andy, that's are good scripts, i'm evaluating and looks good.

I'm try before post here, but I'm not found what is the way to save te results in some directory, like when you use the (image functions)colorize, graysacle, sephia; all of them let you play with the directory for save.

I want save in jpg format

i'm a rookie in php, may be the nswer is on front of my nose, but really I'm not find it; Confused
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 Mar 21, 2007 6:44 am    Post subject: Reply with quote

Hi, and welcome to the board!

You posted in the 'image mask' forum, but your post mentions things like 'sepia' and 'colorize', whcih are actually found in the 'class.image.php' file and nothing to do with the image masking class... As I don't know which one you are really refering to, I'll answer for both. Wink

In the image mask class there is a method called 'saveImage'. It takes at most two parameters - the path name where you want to save the file and the quality of the image (used on when saving jpgs). It's quite easy to use, just something like:

Code:
$im->saveImage('/home/iriejoy/images/save.jpg', 90);


to save the image as a jpeg at 90% quality with the name 'save.jpg' in the '/home/iriejoy/images' directory.

In the image functions class there is no method to save the image. What you would do is use the built-in php/gd functions to save the image yourself, and which one you use depends on what format you want to save. Examples of how to do this can be found in the comments at the top of the class, but as a quick example here:

Code:
$img = imagecreatefromjpeg('original.jpg');
Image::greyscale($img);
imagejpeg($img, '/home/iriejoy/images/save.jpg', 90);


or as a PNG file:

Code:
$img = imagecreatefromjpeg('original.jpg');
Image::greyscale($img);
imagepng($img, '/home/iriejoy/images/save.png');


For more info on the php/gd image functions, check out this link:

http://uk.php.net/manual/en/ref.image.php

Hope that helps!

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