You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't store the exact same preview every time we check for its existence #16544
The Preview class uses a resize method to check if a cached preview already has the proper dimensions, but the calling method doesn't know if a new preview had to be created and saves what it has every time.
/**
* Resizes, crops, fixes orientation and stores in the cache
*
* @param int $fileId fileId of the original image
*/
private function resizeAndStore($fileId) {
// Resize and store
$this->resizeAndCrop();
// We save a copy in the cache to speed up future calls
$cachePath = $this->buildCachePath($fileId);
$this->userView->file_put_contents($cachePath, $this->preview->data());
}
Activity
oparoz commentedon May 29, 2015
The fix is in #16382