Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noclone flag #706

Merged
merged 3 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

+ [#705](https://github.com/luyadev/luya-module-admin/pull/705) Fix issue with SelectArrayGently when using a closure
+ Changed default queueFiltersList to medium-thumbnail instead of meidum-cop
+ [#706](https://github.com/luyadev/luya-module-admin/pull/706) Use `ImageInterface::THUMBNAIL_FLAG_NOCLONE` when creating thumbnails and fix issue with ngrest logger when uploading files.

## 4.3.0 (15. February 2022)

Expand Down
7 changes: 7 additions & 0 deletions src/models/NgrestLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public static function tableName()
return '{{%admin_ngrest_log}}';
}

public function init()
{
parent::init();

$this->detachBehavior('LogBehavior');
}

public function behaviors()
{
return [
Expand Down
4 changes: 3 additions & 1 deletion src/models/StorageFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public function init()
public function behaviors()
{
return [
LogBehavior::class,
'LogBehavior' => [
'class' => LogBehavior::class,
],
[
'class' => TimestampBehavior::class,
'createdAtAttribute' => 'upload_timestamp',
Expand Down
3 changes: 2 additions & 1 deletion src/models/StorageFilterChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use yii\db\ActiveRecord;
use luya\admin\base\FilterInterface;
use Imagine\Image\ManipulatorInterface;
use Yii;

/**
* Contains all information about filter effects for a single Chain element (like: thumbnail, 200x200).
Expand Down Expand Up @@ -134,7 +135,7 @@ public function applyFilter(ImageInterface $image, array $saveOptions)
return [$image, $this->effectChainValue($imagineEffectName, 'saveOptions')];
} elseif ($imagineEffectName == FilterInterface::EFFECT_THUMBNAIL) {
// thumbnail
$image = Image::thumbnail($image, $this->effectChainValue($imagineEffectName, 'width'), $this->effectChainValue($imagineEffectName, 'height'), $this->effectChainValue($imagineEffectName, 'mode'));
$image = Image::thumbnail($image, $this->effectChainValue($imagineEffectName, 'width'), $this->effectChainValue($imagineEffectName, 'height'), $this->effectChainValue($imagineEffectName, 'mode') | ImageInterface::THUMBNAIL_FLAG_NOCLONE);
return [$image, $this->effectChainValue($imagineEffectName, 'saveOptions')];
} elseif ($imagineEffectName == FilterInterface::EFFECT_WATERMARK) {
// watermark
Expand Down
10 changes: 0 additions & 10 deletions src/models/StorageFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ public static function find()
{
return parent::find()->orderBy(['name' => 'ASC']);
}

/**
* @inheritdoc
*/
public function behaviors()
{
return [
LogBehavior::class,
];
}

/**
* @inheritdoc
Expand Down