Commit 8f93196e authored by Sigrid Suski's avatar Sigrid Suski

(!) Image->saveAs() creates editor object if it not already exists

parent f1ca7e0a
......@@ -36,6 +36,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
(+) Added support for WEBP images into Grafika
(+) Introducing of semantic versioning
(!) Image->saveAs() creates editor object if it not already exists
(#) Braces of placeholders aree changed to entities when in urls (Issue #11)
(#) Usage of wrong translation method for some error messages (Txt() instead of Error())
......
......@@ -16,7 +16,7 @@
* 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
* @modified 27 July 2020 by Sigrid Suski
*/
namespace Sobi\FileSystem;
......@@ -138,6 +138,10 @@ class Image extends File
*/
public function saveAs( $path, $type = null )
{
if ( !$this->image ) {
$this->createEditor();
}
return $this->editor
->save( $this->image, $path, $type, Framework::Cfg( 'image.quality', 90 ) );
}
......@@ -174,6 +178,7 @@ class Image extends File
/**
* @return bool
* @throws \Exception
*/
public function fixRotation()
{
......
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