-
Notifications
You must be signed in to change notification settings - Fork 79
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
NEW Remove ImageBackendFactory Injector override from ImageThumbnailHelper #905
NEW Remove ImageBackendFactory Injector override from ImageThumbnailHelper #905
Conversation
@flamerohr You wrote the original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna have a go at profiling this before I approve it.
4535dbe
to
ca5e80b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor feedback
/** | ||
* @var int | ||
*/ | ||
private $maxImageFileSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer protected over private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context that there's a proper accessor and mutator, I think it's better to make it private. My view is people should be using those instead of accessing the variable directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to clarify this policy - consistency is the most important thing in my mind, but we've always gone with protected over private until the last couple of months
private $maxImageFileSize; | ||
|
||
/** | ||
* @param mixed $maxImageSize Maximum file size for which thumbnails will be generated. Set to `0` to disable the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed is not a useful annotation - I think string|int
would be better
|
||
/** | ||
* Set the maximum file size for which thumbnails will be generated. Set to `0` to disable the limit. | ||
* @param mixed $size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest string|int
@robbieaverill I've addressed your feedback in #910 |
…kend-to-reduce-memory-usage MINOR Implement some of the feedback that got missed from #905
ImageThumbnailHelper
overridesImageBackendFactory
withInjectionCreator
. This seems to increase the memory usage systematically when resizing big pictures. Not quite sure why, but I think some object hang around whenInjectionCreator
.This doesn't actually show when calling
memory_get_peak_usage
because the memory is actually used by some process outside of PHP that's responsible for resizing the image.Parent issue