Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Saturday, October 31, 2009

Bangalore PHP Users MeetUp- PHP Best Practices PPT

Bangalore PHP Users MeetUp was held on 31 October 2009 in Bangalore Mircrosoft office . It was organished by Vinu. ( http://tech.groups.yahoo.com/group/bang-phpug/ )

In that meeting, there was the Presentation by Ansar Ahamend for "PHP Best Practices"

Check it out his ppt on click here





Wednesday, September 30, 2009

Microsoft promotes the careers of PHP professionals!

Microsoft is launching a new initiative to promote the careers of PHP professionals.

This article presents an interview with a Microsoft manager to explain in more details what is this initiative and how the PHP professionals may take advantage of it.

Click the below link to view more info.

http://www.phpclasses.org/blog/post/102-Microsoft-promotes-the-careers-of-PHP-professionals.html

Thursday, January 22, 2009

Prepare for ZEND Certificed Engineer

This link will help us to prepare for ZCE Exam(Zend Certified Engineer).

http://saidur.wordpress.com/2008/12/05/how-to-preapre-for-zend-php5-certification-exam/

Tuesday, October 14, 2008

PHP Object-Relational Mapping: ORM or ROM?

Summary: This article talks about what is Object-Relational Mapping (ORM). It also talks about PHP ORM solutions that can make you more productive by allowing the development of your PHP database driven sites progress faster.

For More information :  http://www.phpclasses.org/blog/post/82-PHP-ObjectRelational-Mapping-ORM-or-ROM.html

Saturday, October 4, 2008

Php value configuration in .htaccess

Introduction

There are some php language settings that must be set for phpWebSite to function correctly. It is not our job here to survey every php runtime configuration setting. That is the job of the php on-line manual http://us3.php.net/manual/en/configuration.php. What this part of the guide strives to do is show you the settings that may make most new phpWebSite installations stumble when they are not set correctly. You must adjust these settings in the php.ini file. This is the primary place to make the changes. There are several other ways to make these changes should your site be supported by a web hosting company. Knowledge of these settings is helpful when you have to raise a support ticket with your selected web hosting company or if you have a Linux admin supporting you. It may be helpful to ask about these paramenters in a pre-sales question with a potential web hosting company. Their answers may help you decide to choose another company.

There are three ways to set these parameters. One is the php.ini file. A typical Linux distribution will place this file in /etc/php.ini,. The second way to set these values is by using the Apache .htaccess file that you can store in your phpWebSite Root directory. The third and final way to set these parameters is programmatically through the phpWebSite Core.php file. The file can be found in phpWebSite Root/core/Core.php.

Missing image
Warning.png
Warning

You should decide on one of the three different ways of setting these values. You will have to use your best judgement because each php runtime environment that phpWebSite can be installed in has its own variations. Take these settings as a general guideline for how to configure php in your web server's environment.

php.ini

In this section the runtime configuration parameters are examined in depth as far as phpWebSite is concerned.

Missing image
Caution.png
Caution

Note that setting the configuration parameters in the php.ini file will affect all the other php applications on the same server. A missconfiguration in one of these values will torpedo your whole site not to mention phpWebSite.

Missing image
Warning.png
Warning

As noted with the other two ways of making these changes you should only pick one of these and use it alone.

include_path

This is one of the most important configuration parameters to set for phpWebSite. Please review the phpWebSite Onion. phpWebSite implementations use include_path to set the php language path to include the phpWebSite Root/lib/pear library that is shipped with each phpWebSite release. You will want to edit the include_path , if you are having problems.

Missing image
Caution.png
Caution

Most new users struggle with this at first. An example error might be: "When I get to Step 4 to load http://www.yourdomain.edu/setup, I get the following error: "

Warning: main(../core/Core.php) [function.main]: failed to create stream:
Permission denied in /user2/rwj/public_html/phpws/setup/index.php on line 9

Fatal error: main() [function.main]: Failed opening required '../core/Core.php'
(include_path='.:/usr/local/php-4.3.1/lib/php') in /user2/rwj/public_html/phpws/setup/index.php on line 9

There are three things that are useful to have in the include_path. They are

* The dot ( . ) directory. The dot directory is also known as the current working directory.
* The pear library path that you will be using with your phpWebSite implementation. This will be phpWebSite Root/lib/pear/. As noted in other places, phpWebSite Root will vary from site to site depending on how you are hosting phpWebSite.
* The location of all the standard php system code. This could be /usr/lib/php or if your site is in transition to another version of the php language, then the site administrator may have installed your __stable__ version of the php language as /usr/lib/php4 . Putting all these considerations together your path should look something like the following. Also note that a colon ( : ) is required to separate all the values that we need assign to the include_path setting.

include_path = ".:phpWebSite Root/lib/pear/:/usr/lib/php4"

Please see http://us3.php.net/manual/en/ini.sect.path-directory.php#ini.include-path for more information.

The "failed to create stream: Permission denied" error message in the above example is the perfect segway into the session.save_path setting. Misconfigured settings for both the include_path and session.save_path settings may harmoniously blow up in your face together.

session.save_path

Session information is created for each person that hits your site. You should handle this variable with security concerns in mind. That being said the session.save_path can have a wide range of values. These may range from a simple directory like /tmp to special directories like /var/lib/php/session depending on your Linux distribution's philosophy. A web hosting company may create a special directory for this depending on their philosophy. A web hosting company's automated account creation scripts may place this directory some where in your account's web files directory.

Additional ideas govern the values stored in this setting. Let's say you set session.save_path to /tmp. Well you need to make sure the /tmp directory is located on a disc drive that has space. In addition, this directory should be writable by the web server. Periodic maintenance is also required on this directory. If you have a bizillion files in this directory, php may experience problems. This is not just a php issue. Other applications can perform poorly, if the temporary directory used to save working files is full of old files. After noting security concerns, space limitation, the php application mix on your server, and your determination to monitor the number of files in the directory that you are going to set this value to, then you may decide on /var/lib/php/session as the correct value.

session.save_path = /var/lib/php/session

Please see http://us3.php.net/manual/en/ref.session.php#ini.session.save-path for more information. The session.save_handler parameter may also come into play http://bugs.php.net/bug.php?id=25876. You may also want to consult your Linux distribution's documentation.

phpWebSite failed a session test. If your PHP installation is not configured to allow sessions,
you will not be able to run phpWebSite. Please check your session path in your php.ini file
and make sure your version of php supports superglobals(greater than version 4.1.2)


Missing image
Note.png
Image:Note.png

Note that only one of many session variables have been covered. Some of the other session.* settings may help you resolve problems. The related parameters all start with session. Hence, the session.* notation. A few of these session problems are may be answered in the Session Related Issues page. An example session configuration error message related to incorrect session.* settings is shown above. Special thanks go to sourceForge user akumaish for posting a response to this error message in the phpWebSite forums

Still having problems? Please review this short summary of trouble shooting ideas that were covered in this section.

1. Have you configured session.save_path to begin with in your php.ini file?
2. Do you have the correct directory for Linux or MS Windows? /tmp or C:\tmp.
3. Does the directory exist? /tmp or C:\tmp
4. Does the directory have read and write permissions for your webserver software--apache--to the temporary directory created for the session files?
5. After many days, weeks, of months of use, have you deleted old session files?
6. Do you have enough disk space available for the session files? If the disk drive where your temporary file is located runs out of space, then you will receive the "failed a session test" error. Having no disk space is just like not having created a temporary directory to store the files or having the correct permissions on the directory.


Path Summary

So far several sections of this page have covered information about correctly setting paths. Problems can arise on a correctly configured and working phpWebSite installation. Typical problems occur when key server software are upgraded. Typically the php.ini settings that cover paths that have been configured above should be rechecked if your site starts experiencing problems. Here's an example from a real life forum post:

* "I have changed my site URL but I now get an error message telling me the file is not in the "allowed path(s)." The error message is surprising as the path so far as I know has been removed. The conf/config.php file has been correctly modified. There must be some place that the script is still getting the old path information from. Can anybody help me figure where the next change should be?" (https://sourceforge.net/forum/message.php?msg_id=3824049)

* One proposed solution looked at the openbasedir php configuration settings. (https://sourceforge.net/forum/message.php?msg_id=3824145)

* Even though the openbasedir setting was not the answer, the answer provided a catalyst for a possible place to look: "The 'allowed paths' message refers to the hard-coded paths in your php.ini file. The php.ini settings were created initially by a wizard set-up by the ISP. The ISP allows me access to edit these settings as I'm running PHP in CGI mode. The "allowed path(s) problem is all sorted now, so thanks for the spark needed to solve the problem!" (https://sourceforge.net/forum/message.php?msg_id=3824224)

This real life story provides an example of how your functioning phpWebSite can start failing on you for no apparent and obvious reason. If your phpWebSite becomes important to you or others, then this is the time to look at both the Trouble Shooting With phpInfo page and Planning The Installation page. Write the settings of your site down now in a disciplined fashion before the installation, during the installation, or immediately after the installation. The information may not look important now but may be vital to your site's recovery when your Web hosting company pulls the rug out from under you! In this example, these two configuration pages would provide you with a before the problem occurred configuration and after the problem started configuration page. The "after the problem started configuration page" would be developed by using phpInfo.

Special thanks go to SourceForge user mb__mart, Malcolm, for posting back information on the solution to the "allowed path(s)" problem.

memory_limit

The Memory section of the Official Requirements part of this document provides some sample values. After you consult the memory table you may decide on 12M as the correct value. You would then edit your php.ini with this value.

memory_limit = 12M

Trial and error may be required to find the right value depending on the limitations of your phpWebSite installation environment. As noted in the memory table the number of modules that you Boost with the core phpWebSite system will greatly affect how this parameter should be set. If the value in the memory_limit parameter is set too low, then you will receive fatal runtime error messages

Fatal error: Allowed memory size of m bytes exhausted (tried to allocate e bytes) in Unknown on line n

* where m is the the memory limit the was exhausted.
* where e is the number of bytes that the memory limit was exceed by.
* where n is the line number in the phpWebSite system code where the php memory limit setting was exhausted.

The author of this section, Dr kludge, has had to use 16M so that the php squirrel mail application would function properly. Additional information can be found in the phpWebSite official FAQ http://phpwebsite.appstate.edu/index.php?module=faq&FAQ_op=view&FAQ_id=18. Please also see http://us3.php.net/manual/en/ini.sect.resource-limits.php#ini.memory-limit for more information.

max_execution_time

There are times when you will need to adjust max_execution_time. There have been times in past phpWebSite release cycles that this value had to be increased. Start with the default value of 30 first. Some users have set this as high as 120.

max_execution_time = 30

Please see http://us2.php.net/manual/en/ref.info.php#ini.max-execution-time for more information.

max_input_time

There are times when you will need to adjust max_input_time. Start with the default value of 60 first.

max_input_time = 60

Please see http://us3.php.net/manual/en/ref.info.php#ini.max-input-time for more information.

etc.magic_quotes_runtime

This is a setting required on some Linux distributions. You may need to set this value to Off if it was set to On.

etc.magic_quotes_runtime = Off

Please see http://phpwebsite.appstate.edu/index.php?module=faq&FAQ_op=view&FAQ_id=187 or http://us3.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime for more information.

safe_mode_allowed_env_vars

This may be a useful setting when safe mode is set. You may need to set this value to TZ if you are having problems with safe_mode operation of your phpWebSite system.

safe_mode_allowed_env_vars = TZ

Please see http://us4.php.net/features.safe-mode or http://us4.php.net/manual/en/features.safe-mode.php#ini.safe-mode-allowed-env-vars for more information.

Restart The Web Server

I'll put this important reminder in the php.ini section. Anytime that you make a /etc/php.ini setting change, then you must restart the web server. Now friends and countryman, your author, would like to save you some embarassment. Yes friends there have been times when yours truely has made changes to the /etc/php.ini and has been pounding his head against the wall. The php.ini file changes were not working as advertised. Not only was he angry X-( and red faced :o he now can share those wonderful stories from the school of hard knocks with you. :\ Anytime that you make changes to your /etc/php.ini file and your web service is running, please issue this command.

su - root -c "/etc/rc.d/init.d/httpd restart"

Yep. The sample restart command is based off of a Red Hat Linux distribution. You should be able to find how to perform this command on your Linux distribution based on the example given. Missing image
Note.png
Note

Note: You will not have to perform this step for the other two php language environment configurations. Those options are dynamic because each option is evaluated each time your site is accessed.

Apache .htaccess File

This is the second example of how to configure your php language environment.

Missing image
Warning.png
Warning

As noted with the other two ways of making these changes you should only pick one of these and use it alone.

Normally, the Apache web server uses an httpd.conf file to store all of its settings. A Linux distribution may create the file in /etc/httpd/conf directory. This file and the rest of the /etc directory contents are off limits to most users on a Linux system except for the root user. The Apache software development team has created another mechanism to allow a user in a web hosting company supported environment to change some of the web server settings. This flexibility may be turned off or on as the web hosting company sees fit. Speaking of flexibility, an .htaccess file comes with a cost. The .htaccess file has to be parsed by the Apache web server each time a file is served out of the directory covered by one of these files. This may be be the perfect solution for configuring the php language when a web hosting company is involved. On the one hand, they will not let you edit the /etc/php.ini file. On the other hand, the WebHostingCompany may not let php application code use the ini_set(); function. So we will happly embrace the performance hit so that we can access all the power that the phpWebSite CMS provides our new site.

include_path

php_value include_path ".:PhpWebSiteRoot/lib/pear/:/usr/lib/php4"


session.save_path

php_value session.save_path "/tmp"


memory_limit

php_value memory_limit "12M"


max_execution_time

php_value max_execution_time "30"


max_input_time

php_value max_input_time "60"


etc.magic_quotes_runtime

php_value etc.magic_quotes_runtime "Off"


safe_mode_allowed_env_vars

php_value safe_mode_allowed_env_vars "TZ"


A Sample .htaccess File

php_value arg_separator.output "&"
php_value arg_separator.input "&"
php_value include_path ".:PhpWebSiteRoot/lib/pear/:/usr/lib/php4"
php_value session.save_path "/tmp"
php_value memory_limit "12M"
php_value max_execution_time "30"
php_value max_input_time "60"
php_value etc.magic_quotes_runtime "Off"


Programmatically Setting php.ini Values

This is the third and last example of how to configure your php language environment.

Missing image
Warning.png
Warning

As noted with the other two ways of making these changes you should only pick one of these and use it alone.

Information on the ini_set() function is located here http://us3.php.net/manual/en/function.ini-set.php. The php.ini section went into the details on each of these values. The only difference here is how the value is changed. For example memory_limit = 12M in the php.ini section will not be coded as ini_set("memory_limit", "12M");. You will want to add these ini_set() function calls to the Core.php program file. phpWebSite will dynamically set these values during the execution of the Core.php file. You can find this file in here phpWebSite Root/core/Core.php. The file may be all that you will have to modify when configuring the php language. Missing image
Note.png
Note

Note dynamic settings proposed in this section of the document may not be supported on your web server.

include_path

The only real comment to make here concerns the PHPWS_SOURCE_DIR part of the path. The Access The Setup URL section talks about the initial configuration file. As part of entering data in this first screen you will provide the phpWebSite Root directory information. For all intents and purposes the phpWebSite Root information that you supply via the setup screen will be stored in the PHPWS_SOURCE_DIR variable. The rest of the phpWebSite system will use this value. All of the code will function properly or die splendidly based on your thoughtful understanding of what phpWebSite Root means for your site. __Your judgement is crucial here!__

ini_set("include_path", ".:" . PHPWS_SOURCE_DIR . "lib/pear/:/usr/lib/php4");


session.save_path

ini_set("session.save_path", "/tmp");


memory_limit

ini_set("memory_limit", "12M");


max_execution_time

ini_set("max_execution_time", "30");


max_input_time

ini_set("max_input_time", "60");


etc.magic_quotes_runtime

ini_set("etc.magic_quotes_runtime", "Off");


safe_mode_allowed_env_vars

ini_set("safe_mode_allowed_env_vars, "TZ");


-------------

Wednesday, September 24, 2008

Convert MS/Word to PDF in unix/linux

OpenOffice.org has a powerful support for plugings (called Macros) that allow a lot of additional functionality to be added to application. One common task is to convert MS/Word documents (.doc) into PDF. The recipe here uses Basic to program an OpenOffice.org macro to convert from DOC to PDF. We then illustrate how to turn this into a command line tool to convert from DOC to PDF. (This example was developed by DannyB.)

First, start up OpenOffice.org, perhaps as oowriter. Then from the Tools menu, select Macros, Organize Macros, OpenOffice.org Basic. A window will popup. Navigate, in the Macro from area, to My Macros, Standard, Module1. Edit the module to include just the following code:

REM ***** BASIC *****

Sub ConvertWordToPDF(cFile)
cURL = ConvertToURL(cFile)

' Open the document.
' Just blindly assume that the document is of a type that OOo will
' correctly recognize and open -- without specifying an import filter.
oDoc = StarDesktop.loadComponentFromURL(cURL, "_blank", 0, Array(MakePropertyValue("Hidden", True), ))

cFile = Left(cFile, Len(cFile) - 4) + ".pdf"
cURL = ConvertToURL(cFile)

' Save the document using a filter.
oDoc.storeToURL(cURL, Array(MakePropertyValue("FilterName", "writer_pdf_Export"), ))

oDoc.close(True)

End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function


Save and exit from OpenOffice.org.

Now create a shell script, perhaps called doc2pdf in /usr/local/bin with:

#!/bin/sh

DIR=$(pwd)
DOC=$DIR/$1

/usr/bin/oowriter -invisible "macro:///Standard.Module1.ConvertWordToPDF($DOC)"


Then simply run it:

$ doc2pdf my.doc


and you should end up with a my.pdf!

The script is nothing perfect, and there is an issue in that the script will return before OpenOffice.org has finished its work. This, to convert a whole directory of files, you may want sonething like:

$ for i in *.doc; do echo $i; doc2pdf "$i"; sleep 5; done

check it out more here:
http://www.togaware.com/linux/survivor/Convert_MS_Word.html

Wednesday, September 3, 2008

Split Example in PHP

<?
$str="sasikumar123inia567medical456";
$split1=split('[0-9]',$str);
echo "<pre>";
print_r($split1);
echo "</pre>";
?>


To find the Curent time minus 15 minits

<?
echo time();
echo "<br>";
echo $timerange =time()-900; //20 minutes from now
?>

php Subtract the Time

<?php

function subtractTime($hours=0, $minutes=0, $seconds=0, $months=0, $days=0, $years=0)

{

$totalHours = date("H") - $hours;

$totalMinutes = date("i") - $minutes;

$totalSeconds = date("s") - $seconds;

$totalMonths = date("m") - $months;

$totalDays = date("d") - $days;

$totalYears = date("Y") - $years;

$timeStamp = mktime($totalHours, $totalMinutes, $totalSeconds, $totalMonths, $totalDays, $totalYears);

$myTime = date("Y-m-d H:i:s A", $timeStamp);

return $myTime;

}

// Let us first see the current time

echo "Current Time:"  . date("Y-m-d H:i:s A");

echo "<BR>";

// Now let us deduct 5 hours, 2 days and 1 year from now

echo "New Time: " .subtractTime(0,15,0,2,0,0);

?>

Friday, August 22, 2008

How to zip the file or folder using exec command in php

here u can find the solution for How to zip the file or folder using exec command in php?

echo $cmd="zip -r ziffilename.zip foldername";
echo "<br>";
exec($cmd,$out,$res);
if($res==0)
{
echo "fine";
}
else
{
echo "pblm";
}

Sunday, July 13, 2008

Image Magic in Linux convert pdf to jpj convert jpg to gif everythink is working fine

ImageMagick: A graphics wizard for the command line

By Shashank Sharma on March 30, 2005 (9:00:00 AM)

Share    Print    Comments   

For many a GNU/Linux user, the command line is supreme. But can you manipulate images without switching to the GUI and using the resource-hungry GIMP? You can, using the fantastic ImageMagick suite.

With ImageMagick (IM) you can crop your image, change its shades and colors, and add captions, among other operations.

Basic image manipulations

IM packs a nifty utility, convert, that can handle this. In addition to changing the size of an image, convert can convert it from one format to another (IM supports almost 90 different image formats), rotate an image, and add effects to an image.

To convert one image into a thumbnail for my blog, I ran the command convert -sample 80x60 big.jpg thumb.jpg. Here, big.jpg is the input image and thumb.jpg is the output image, which is to be 80x60 pixels. -sample tells IM to scale the image using pixel sampling. You can also specify percentages instead of pixels by using syntax such as convert -sample 30%x30% big.jpg thumb.jpg. ImageMagick maintains the aspect ratio of an image, which results in symmetric images.

Convert can also rotate or flip an image:

convert -rotate 90 image_0001.tiff output.tiff

The -rotate switch, by default, rotates the image clockwise by the number of degrees specified. If you wish to rotate the image counter-clockwise, use a negative number.

The -flip switch produces an upside-down image of the original while the -flop switch turns the image on a vertical axis.

convert -flip me.jpg me_flipped.jpg
convert -flop me.jpg me_flopped.jpg

You can change a JPG file to PNG with a command such as convert one.jpg newone.png. If you have a huge collection of images to convert, use IM's mogrify utility with the -format switch:

mogrify -format tiff *.png

You can also use mogrify to create same-sized thumbnails of multiple images:

mogrify -sample 80x60 *.jpg

Be careful, however -- this command will overwrite your existing images! If you wish to preserve the originals, you have to use a different format for the thumbnails. For instance, this command would make PNG thumbnails of all your JPG files:

mogrify -format png -sample 15%x15% *.jpg

Adding other effects to an image

Among its many options, convert offers artistic effects to enhance your images, including charcoal, colorize, implode, solarize, and more. I find the charcoal effect really cool; it looks like an artist's initial draft, with no colors, just a sketch made with charcoal. To apply the effect, use a command such as:

convert -charcoal 1 me.png coal.png

The numeric value specified refers to the amount of charcoal you want in the image.

Playing with PDFs

Now imagine you're traveling, and you want to share some photos with your friends. Your mail client may allow large attachments, but how many attachments do you really want to send? The convert utility lets you to put all your images into one neatly organized PDF file, one image per page, with a command such as:

convert *jpg allinone.pdf

Convert also lets you extract all the images from a PDF file:

convert allinone.pdf image_%04d.tiff

The %d operator is a format specifier, much like the printf format specifier in C language. %d means a decimal number, and the 0 that follows it means you want leading zeroes in the file name. The 4 after the 0 specifies how many digits the total value should use. So, %04d means that you want leading zeroes and the total number of digits should be four, thus creating files named image_0001.tiff, image_0002.tiff, and so on.

You can also run the command without the %d operator; convert will automatically append unique numbers to the filename.

convert allinone.pdf img.png
ls img*
img.png.0 img.png.1 img.png.2

Adding text

If you're a prolific digital photographer, how do you distinguish one set of images from another? One good way is to put a tag on all the images -- a word or two describing where and when they were snapped.

I labeled a few picture from a recent trip to Bangalore using convert:

convert -font helvetica -fill yellow -pointsize 25 \
> -draw 'text 100,250 "Nandi Hills, Bangalore"' \
> image.png text.png

This command specifies the font, color, and size of the text, its location (specified by the column and row in pixels where text should begin), and the actual text itself. You can add text at two different locations in different colors like so:

convert -font helvetica -fill yellow -pointsize 36 \
> -draw 'text 100,250 "Nandi Hills, Bangalore"' \
> -fill green -draw 'text 150,300 Beautiful' \
> image.png text.png

Notice the variations in quotes. Use double quotes when you need to draw more than one word on your image. If you have only one word to write, you don't need to include it within double quotes.

You can specify different font sizes for the two texts, and, if the font you wish to use if it is in a non-standard directory, you can include the path to the font in the command as well.

Frames for your images

Frames and borders help enhance images and make them more appealing. To add a simple solid-colored frame around your image, use a command such as:

convert -bordercolor blue -border 5x5 pic001.png border001.png

In the size specification (5x5), the horizontal size comes first and then the vertical. You can't make a frame larger than the picture, and you must specify the border color. You can check the complete list of colors IM supports for border, text, and backgrounds with the command convert -list color.

I like frames with raised and lowered borders. To create a raised border, use the -raise option along with the dimensions:

convert -raise 5x5 image.png raised.png

To create a lowered border, replace the hyphen before the raise argument with a plus-sign.

For more complex frames with padded borders, you can use the -mattecolor and the -frame options in place of -bordercolor and -border.

Conclusion

Being a command-line tool has its advantages. You can make all of the above mentioned modifications through scripts written using programming languages such as Perl, Python, and C/C++. ImageMagick also provides interfaces for various languages -- PerlMagick (Perl), Magick++ (C++), PythonMagick (Python), MagickWand (PHP), RMagcik (Ruby), TclMagick (Tcl) and JMagick (Java).

While all we've talked about has been command-line operations, IM also has a GUI which you can invoke with the command display.

Shashank Sharma is a computer science student who loves to write about free and open source software for new users.

Shashank Sharma specializes in writing about free and open source software for new users and moderates the Linux.com forum boards. He is the coauthor of Beginning Fedora, published by Apress.