Permalink
Browse files

BackwardsCompatibilityBreak - fImage::getInfo() is now protected. Als…

…o added some info accessors per ticket #35.
  • Loading branch information...
wbond committed Aug 12, 2008
1 parent 37f2801 commit 0231c73905bd590d1cd4e446cce1eb82249470d7
Showing with 34 additions and 1 deletion.
  1. +34 −1 classes/filesystem/fImage.php
@@ -257,7 +257,7 @@ static public function getCompatibleMimetypes()
* @param string $element The element to retrieve ('type', 'width', 'height')
* @return array An associative array: 'type' => {mixed}, 'width' => {integer}, 'height' => {integer}
*/
static public function getInfo($image_path, $element=NULL)
static protected function getInfo($image_path, $element=NULL)
{
$image_info = @getimagesize($image_path);
if ($image_info == FALSE) {
@@ -588,6 +588,39 @@ private function getCurrentDimensions()
}
/**
* Returns the height of the image
*
* @return integer The height of the image in pixels
*/
public function getHeight()
{
return self::getInfo($this->file, 'height');
}
/**
* Returns the type of the image
*
* @return string The type of the image - 'jpg', 'gif', 'png' or 'tif'
*/
public function getType()
{
return self::getInfo($this->file, 'type');
}
/**
* Returns the width of the image
*
* @return integer The width of the image in pixels
*/
public function getWidth()
{
return self::getInfo($this->file, 'width');
}
/**
* Checks if the current image is an animated gif
*

0 comments on commit 0231c73

Please sign in to comment.