Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Let extract task throw exceptions when the extracting itself fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
roelvanhintum committed Jan 27, 2020
1 parent 2954649 commit 6681564
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.0.6 - 2020-01-27
### Changed
- Let extract task throw exceptions when the extracting itself fails.

## 2.0.5 - 2019-10-11
### Changed
- Log warnings when `ColorExtractorTask` fails, instead of throwing exceptions.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "born05/craft-colorextractor",
"description": "Extract colors from image assets in Craft CMS. Requires a field named `imageColor` on all assets of kind image (can be color or plaintext)",
"type": "craft-plugin",
"version": "2.0.5",
"version": "2.0.6",
"keywords": [
"craft",
"cms",
Expand Down
9 changes: 1 addition & 8 deletions src/services/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ public function getImageColor(AssetElement $asset, bool $forceSave = false)

// Only Extract color when forced.
if ($forceSave && isset($asset->imageColor)) {
try {
$color = $this->extractColor($asset);
} catch (Exception $e) {
Craft::error(
$e->getMessage(),
__METHOD__
);
}
$color = $this->extractColor($asset);

if (!empty($color)) {
$asset->setFieldValue('imageColor', $color);
Expand Down

0 comments on commit 6681564

Please sign in to comment.