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

Commit

Permalink
Prevent svg's from breaking on upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
roelvanhintum committed Feb 27, 2018
1 parent 87ffc8b commit 08afbd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ColorExtractorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function getName()

public function getVersion()
{
return '1.0.3';
return '1.0.4';
}

public function getDeveloper()
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "1.0.4",
"downloadUrl": "https://github.com/born05/craft-colorextractor/archive/1.0.4.zip",
"date": "2018-02-27T11:30:00+00:00",
"notes": [
"Prevent svg's from breaking on upload."
]
},
{
"version": "1.0.3",
"downloadUrl": "https://github.com/born05/craft-colorextractor/archive/1.0.3.zip",
Expand Down
4 changes: 2 additions & 2 deletions services/ColorExtractor_AssetUploadService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public function onReplaceFile(Event $event)
{
$asset = $event->params['asset'];

if ($asset->kind === 'image') {
if ($asset->kind === 'image' && $asset->mimeType !== 'image/svg+xml') {
craft()->colorExtractor_asset->getImageColor($asset, true);
}

Expand All @@ -19,7 +19,7 @@ public function onSaveAsset(Event $event)
if ($event->params['isNewAsset']) {
$asset = $event->params['asset'];

if ($asset->kind === 'image') {
if ($asset->kind === 'image' && $asset->mimeType !== 'image/svg+xml') {
craft()->colorExtractor_asset->getImageColor($asset, true);
}
}
Expand Down

0 comments on commit 08afbd9

Please sign in to comment.