grav-plugin-resize-images icon indicating copy to clipboard operation
grav-plugin-resize-images copied to clipboard

Plugin does not resize images when used in Grav v1.7.0-rc.7 - Admin v1.10.0-rc.7

Open Hendrik-Koehler opened this issue 4 years ago • 5 comments

However, this was still working with Grav v1.7.0-beta.5 - Admin v1.10.0-beta.5 Now, after Grav Updates, it does not trigger resizing of images anymore. After downgrade, it is working again. Any idea how to overcome this?

Hendrik-Koehler avatar Mar 05 '20 22:03 Hendrik-Koehler

I don't maintain this plugin anymore, but am willing to accept a PR if you find a way to solve the problem! I had a quick look at the changelog for Grav and the admin plugin, but unfortunately nothing stood out to me, so I don't have any advice where to start

fredrikekelund avatar Mar 06 '20 08:03 fredrikekelund

I just came across this issue today – bummer. I love this plugin, it is very very useful for me! I shall look into fixing this as soon as I can find some time. However, I am by no means super knowledgeable on these bits of code, so if anyone feels like helping out as well, feel free to contact me and maybe we can team up.

skinofthesoul avatar Aug 07 '20 09:08 skinofthesoul

Hey I ran some tests and the issue seems to be with neither Grav nor the Admin plugin – if you have the latest version of both, the images still get resized as expected. However, the images fail to be resized if you add the flex-objects plugin to the mix, from its version 1.0.0-rc.4. Which incidentally is the version from which the pages are shown differently in Admin.

I need to take a break from debugging now, but maybe this gives someone an idea as to what the problem is?

skinofthesoul avatar Aug 07 '20 19:08 skinofthesoul

I've been digging some more: the reason the plugin is doing nothing since the switch from page objects to flex objects is this line:

if (!$page instanceof Page) {
    return false;
}

So far so good. If I just comment this out however Grav is spitting out errors, I have not yet found out how exactly these new flex objects work. However! I've discovered that you can actually deactivate the flex option for your pages in the flex objects plugin settings. If you do that, your pages revert to their former look and feel as one long list (with sublists), and Resize Images works as you'd expect. So that may be a very usable solution for people with not too many pages.

skinofthesoul avatar Aug 22 '20 20:08 skinofthesoul

I have just upgraded to Grav 1.7 and this plugin has stopped working. This is a really useful plugin, so thank-you to skinofthesoul for your workaround. I have disabled the flex plugin for pages and resizing is working again

madaboutbrighton avatar Jan 20 '21 11:01 madaboutbrighton