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

Optimize on resize/crop (variations) doesn't function #2

Closed
iangregory opened this issue Jan 2, 2018 · 4 comments
Closed

Optimize on resize/crop (variations) doesn't function #2

iangregory opened this issue Jan 2, 2018 · 4 comments

Comments

@iangregory
Copy link

I have AutoSmush configured only to optimize on resize/crop (variations). However, I can see from the logs that this does't work - the images are never optimized.

Having reviewed the code it appears that the hook is being added on line 1256 in the ready() function.

However, we return earlier in that function (line 1207) if the page is not an admin page, so the hook is never added.

Commenting out line 1207 causes images to be smushed when they're resized (i.e. on first load) as expected.

@matjazpotocnik
Copy link
Owner

Hm, it's working here. Could you enable debug mode and see if the hook is applied? Also please add

$this->log->save($page->template->name);

before line 1207, just to check what is the template name.

@iangregory
Copy link
Author

Debug mode indicates the hook isn't being applied. The template name is 'home'

2018-01-16 21:00:22 home

@matjazpotocnik
Copy link
Owner

Hmm... How do you create variations? Could you also log $page->process?

@matjazpotocnik
Copy link
Owner

This is fixed in 1.1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants