Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Resizing breaks when updating to 2.1.0 #42

Closed
GuidoHendriks opened this issue Jan 26, 2016 · 7 comments
Closed

Resizing breaks when updating to 2.1.0 #42

GuidoHendriks opened this issue Jan 26, 2016 · 7 comments
Labels

Comments

@GuidoHendriks
Copy link

After updating from 2.0.0 to 2.1.0, my images won't be resized any longer. They are saved for every size tho.

The config I'm using:

Configure::write('FileStorage', [
    'imageSizes' => [
        'Image' => [
            't200' => [
                'thumbnail' => [
                    'width' => 200,
                    'height' => 200
                ]
            ]
        ],
    ],
]);

Any idea what's going on or what I should check to make this work again?

@burzum
Copy link
Owner

burzum commented Jan 26, 2016

There is an unit test for this feature.

https://github.com/burzum/cakephp-imagine-plugin/blob/master/tests/TestCase/Model/Behavior/ImagineBehaviorTest.php#L149

You can even disable the cleanup and check the generated image if the size is correct. Are there any errors or something else shown? Or is it just not creating the correct size?

@burzum burzum added the Bug label Jan 26, 2016
@burzum
Copy link
Owner

burzum commented Jan 26, 2016

OK, I can confirm it's an issue which I thought I have resolved.

See php-imagine/Imagine#478 this as well, their support is terrible slow.

@GuidoHendriks
Copy link
Author

But this doesn't seem to be a Imagine problem. The same version of it is used, only the version of this plugin is changed.

@burzum
Copy link
Owner

burzum commented Jan 26, 2016

I'm more than happy if you can provide a better idea. I think it has something to do with the way the instance is passed around in the ImageProcessor lib vs the Behavior before.

Also, like I write in the ticket, this even happens with their very own tutorial code. Also I had do do the & reference in the old behavior to make this work for some weird reason. I'm pretty sure there is something wrong going on with the instance.

@burzum
Copy link
Owner

burzum commented Jan 27, 2016

The issue is really weird, the unit tests for it work just fine. I've checked even the generated images manually if the size is really what I expect and it is correct.

@burzum
Copy link
Owner

burzum commented Jan 27, 2016

@GuidoHendriks I can't do much about this I think.

See https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Image/AbstractImage.php#L42

        // Won't work
        $thumbnail = $this->copy();
        // Works
        $thumbnail = $this;

Honestly, I have no idea why this was working before, nor why the copy is required here because it's not working when using copy().

@burzum
Copy link
Owner

burzum commented Jan 27, 2016

@GuidoHendriks please try the 2.x branch, this commit d21f2e9, should fix the problem. It is still a workaround but I doubt Imagine is going to fix it any time soon. I still don't even understand the exact cause of the issue.

@burzum burzum closed this as completed in d21f2e9 Jan 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants