Alpha Framework alpha--view--widgets
[ class tree: alpha--view--widgets ] [ index: alpha--view--widgets ] [ all elements ]

Class: Image

Source Location: /view/widgets/Image.inc

Class Image

Class Overview

A widget that can generate an image which is scaled to the screen resolution of the user, and can be made secured to prevent hot-linking from remote sites. Note that by default, a jpg file will be returned (the source file can be jpg, png, or gif).

Located in /view/widgets/Image.inc [line 59]



		
				Author(s):
		
  • John Collins <dev@alphaframework.org>
Information Tags:
Version:  $Id: Image.inc 1341 2011-03-17 15:02:02Z johnc $
Copyright:  

Copyright (c) 2011, John Collins (founder of Alpha Framework). All rights reserved.

 Redistribution and use in source and binary forms, with or
 without modification, are permitted provided that the
 following conditions are met:

 * Redistributions of source code must retain the above
   copyright notice, this list of conditions and the
   following disclaimer.
 * Redistributions in binary form must reproduce the above
   copyright notice, this list of conditions and the
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 * Neither the name of the Alpha Framework nor the names
   of its contributors may be used to endorse or promote
   products derived from this software without specific
   prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Since:  1.0
License:  The BSD License

Methods

[ Top ]
Method Summary
static string   convertImageURLToPath()   Converts a URL for an image to a relative file system path for the image, assuming it is hosted on the same server as the application.
Image   __construct()   The constructor.
void   getFilename()   Gets the auto-generated filename for the image in the /cache directory
string   renderHTMLLink()   Renders the HTML <img> tag to the ViewImage controller, with all of the correct params to render the source image in the desired resolution.
void   renderImage()   Renders the actual binary image using GD library calls.

[ Top ]
Methods
static method convertImageURLToPath  [line 425]

  static string convertImageURLToPath( string $imgURL  )

Converts a URL for an image to a relative file system path for the image, assuming it is hosted on the same server as the application.

Parameters:
string   $imgURL: 

API Tags:
Return:  the path of the image
Access:  public

Information Tags:
Since:  1.0

[ Top ]
Constructor __construct  [line 154]

  Image __construct( $source $source, $width $width, $height $height, $sourceType $sourceType, [$quality $quality = 0.75], [$scale $scale = false], [ $secure = false]  )

The constructor.

Parameters:
$source   $source: 
$width   $width: 
$height   $height: 
$sourceType   $sourceType: 
$quality   $quality: 
$scale   $scale: 
   $secure: 

API Tags:
Access:  public

Information Tags:
Throws:  IllegalArguementException
Since:  1.0

[ Top ]
getFilename  [line 251]

  void getFilename( )

Gets the auto-generated filename for the image in the /cache directory


API Tags:
Access:  public

Information Tags:
Since:  1.0

[ Top ]
renderHTMLLink  [line 192]

  string renderHTMLLink( [$altText $altText = '']  )

Renders the HTML <img> tag to the ViewImage controller, with all of the correct params to render the source image in the desired resolution.

Parameters:
$altText   $altText:  Set this value to render alternate text as part of the HTML link (defaults to no alternate text)

API Tags:
Access:  public

Information Tags:
Since:  1.0

[ Top ]
renderImage  [line 260]

  void renderImage( )

Renders the actual binary image using GD library calls.


API Tags:
Access:  public

Information Tags:
Since:  1.0

[ Top ]

Documentation generated on Thu, 17 Mar 2011 16:44:22 +0000 by phpDocumentor 1.4.3