Skip to content

Commit

Permalink
### Changed
Browse files Browse the repository at this point in the history
* Fixed the packagist.org package name to coincide with the plugin renaming
* Added debug `trace` logging in the event handler
* Updated `README.md`
  • Loading branch information
khalwat committed Apr 20, 2017
1 parent 1615be9 commit cf9ae15
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ImageOptimize Changelog

## 1.0.8 - 2017.04.20
### Changed
* Fixed the packagist.org package name to coincide with the plugin renaming
* Added debug `trace` logging in the event handler
* Updated `README.md`

## 1.0.7 - 2017.04.10
### Changed
* Renamed the plugin from `ImageOptim` to `ImageOptimize`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Automatically optimize images after they've been transformed

To install ImageOptimize, follow these steps:

1. Install with Composer via `composer require nystudio107/craft3-ImageOptimize`
1. Install with Composer via `composer require nystudio107/craft3-imageoptimize`
2. Install plugin in the Craft Control Panel under Settings > Plugins

ImageOptimize works on Craft 3.x.
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": "nystudio107/craft3-imageoptimize",
"description": "Automatically optimize images after they've been transformed",
"type": "craft-plugin",
"version": "1.0.7",
"version": "1.0.8",
"keywords": [
"craft",
"cms",
Expand Down
6 changes: 5 additions & 1 deletion src/ImageOptimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ public function init()
parent::init();
self::$plugin = $this;

// Listen for image transform events
// Handler: AssetTransforms::EVENT_GENERATE_TRANSFORM
Event::on(
AssetTransforms::className(),
AssetTransforms::EVENT_GENERATE_TRANSFORM,
function (GenerateTransformEvent $event) {
Craft::trace(
'AssetTransforms::EVENT_GENERATE_TRANSFORM',
'imageoptimize'
);
// Return the path to the optimized image to _createTransformForAsset()
$event->tempPath = ImageOptimize::$plugin->optimize->handleGenerateTransformEvent(
$event
Expand Down

0 comments on commit cf9ae15

Please sign in to comment.