Most Referenced Functions
  » google_pagerank()
  » preg_replace()
  » imagecreatefrompng()
  » site_pageranks()
  » imagepng()
  » imagestring()
  » imagedestroy()
  » htmlentities()
  » imagecolorallocate()
  » fopen()
  » preg_match()
  » header()
  » getimagesize()
  » session_start()
  » ob_start()
  » preg_match_all()
  » strstr()
  » ob_flush()
  » flush()
  » htmlspecialchars()
  » str_replace()
  » strpos()
  » array2vars()
  » nl2br()
  » setcookie()
  » urlencode()
  » preg_split()
  » ereg()
  » ereg_replace()
  » var_dump()

Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m.

PHP Functions

Function: imagejpeg

(PHP 3 >= 3.0.16, PHP 4, PHP 5)

imagejpeg -- Output image to browser or file

Description

bool imagejpeg ( resource image [, string filename [, int quality]] )

imagejpeg() creates the JPEG file in filename from the image image . The image argument is the return from the imagecreate() function.

The filename argument is optional, and if left off, the raw image stream will be output directly. To skip the filename argument in order to provide a quality argument just use an empty string (''). By sending an image/jpeg content-type using header() , you can create a PHP script that outputs JPEG images directly.

Note: JPEG support is only available if PHP was compiled against GD-1.8 or later.

quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default is the default IJG quality value (about 75).

If you want to output Progressive JPEGs, you need to set interlacing on with imageinterlace() .

Related Function(s)

  • imagecreate()
  • header()
  • imageinterlace()
  • imagepng()
  • imagegif()
  • imagewbmp()
  • imagetypes()
  • Icemelon -- PHP, CSS, Javascript Tutorials, & More!
      © 2005-2010 Icemelon.com   Email: dave[AT]icemelon[D0T]c0m