1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Images: Started refactor of image service

To break it up.
Also added better memory handling to other parts of the app.
This commit is contained in:
Dan Brown
2023-09-30 18:28:42 +01:00
parent 40721433f7
commit 7247e31936
8 changed files with 340 additions and 261 deletions

View File

@@ -5,6 +5,7 @@ namespace BookStack\Uploads\Controllers;
use BookStack\Exceptions\ImageUploadException;
use BookStack\Http\Controller;
use BookStack\Uploads\ImageRepo;
use BookStack\Util\OutOfMemoryHandler;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
@@ -53,6 +54,10 @@ class GalleryImageController extends Controller
return $this->jsonError(implode("\n", $exception->errors()['file']));
}
new OutOfMemoryHandler(function () {
return $this->jsonError(trans('errors.image_upload_memory_limit'));
});
try {
$imageUpload = $request->file('file');
$uploadedTo = $request->get('uploaded_to', 0);