Back to Image class

Method isLoaded

public bool
isLoaded
()
Method to determine whether or not an image has been loaded into the object.
Returns
  • bool
Since
  • 2.5.0
Class: Image
Project: Joomla

Method isLoaded - Source code

/**
 * Method to determine whether or not an image has been loaded into the object.
 *
 * @return  boolean
 *
 * @since   2.5.0
 */
public function isLoaded()
{
    /**
     * Make sure the resource handle is valid.
     * @todo: Remove check for resource when we only support PHP 8
     */
    if (!(\is_object($this->handle) && get_class($this->handle) == 'GdImage' || \is_resource($this->handle) && get_resource_type($this->handle) == 'gd')) {
        return false;
    }
    return true;
}