Commit 3e8137eb authored by Sigrid Suski's avatar Sigrid Suski

Headers corrected; version set to 1.0.14; changelog restored

parent 2935818e
......@@ -44,5 +44,5 @@ abstract class C
const NO = 0;
const ROOT = JPATH_ROOT;
const DS = DIRECTORY_SEPARATOR;
const VERSION = '1.0.13';
const VERSION = '1.0.14';
}
<?php
/**
* @package : Sobi Framework
* @package: Sobi Framework
*
* @author
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
* Email: sobi[at]sigsiu.net
* Url: https://www.Sigsiu.NET
* @copyright Copyright (C) 2006 - 2018 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
* @license GNU/LGPL Version 3
*
* @copyright Copyright (C) 2006 - 2020 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
* @license GNU/LGPL Version 3
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
* See http://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses.
* See https://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* @modified 02 July 2020 by Sigrid Suski
*/
namespace Sobi\FileSystem;
......@@ -20,6 +25,10 @@ use Grafika\Grafika;
use Sobi\Framework;
use Sobi\Error\Exception;
/**
* Class Image
* @package Sobi\FileSystem
*/
class Image extends File
{
/*** @var array */
......@@ -34,6 +43,8 @@ class Image extends File
/**
* @param $transparency
*
* @throws \Exception
*/
public function setTransparency( $transparency )
{
......@@ -45,7 +56,7 @@ class Image extends File
}
/**
* @param int $sections
* @param int $sections
* @param bool $array
*
* @return array|bool
......@@ -66,12 +77,16 @@ class Image extends File
/**
* Resample image
* Resample image.
*
* @param $width
* @param $height
* @param string $position
* @param int $offsetX
* @param int $offsetY
*
* @return $this
* @throws \Exception
*/
public function & crop( $width, $height, $position = 'center', $offsetX = 0, $offsetY = 0 )
{
......@@ -82,7 +97,7 @@ class Image extends File
}
/**
* Resample image
* Resample image.
*
* @param $width
* @param $height
......@@ -92,7 +107,7 @@ class Image extends File
*/
public function & resample( $width, $height )
{
list( $wOrg, $hOrg, $imgType ) = getimagesize( $this->_filename );
[ $wOrg, $hOrg, $imgType ] = getimagesize( $this->_filename );
/* if not always and image is smaller */
......@@ -114,12 +129,25 @@ class Image extends File
return $this;
}
/**
* @param string $path
* @param null $type
*
* @return bool|\Grafika\EditorInterface
* @throws Exception
*/
public function saveAs( $path, $type = null )
{
return $this->editor
->save( $this->image, $path, $type, Framework::Cfg( 'image.quality', 90 ) );
}
/**
* @param null $type
*
* @return bool|\Grafika\EditorInterface
* @throws Exception
*/
public function save( $type = null )
{
$this->createEditor();
......@@ -129,16 +157,18 @@ class Image extends File
}
/**
* Rotate image
* Rotate image.
*
* @param $angle
*
* @return $this
* @throws \Exception
*/
public function & rotate( $angle )
{
$this->createEditor();
$this->editor->rotate( $this->image, $angle );
return $this;
}
......@@ -169,6 +199,7 @@ class Image extends File
}
/**
* @throws \Exception
*/
protected function createEditor()
{
......
......@@ -31,6 +31,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
(!) Change
### 1.0.14 (31 Juli 2020)
(+) Added support for WEBP images into Grafika
### 1.0.13 (05 June 2020)
(+) Output of error messages added
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment