Open jssolo opened 1 year ago
具体的报错信息如下
[2023-03-06 21:51:17] prod.ERROR: Web 上传文件时发生异常 {"file":"/www/wwwroot/tc/vendor/intervention/image/src/Intervention/Image/Imagick/Decoder.php","line":29,"message":"Unable to read image from path (/tmp/phpHbZXgw).","trace":"#0 /www/wwwroot/tc/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(329): Intervention\\Image\\Imagick\\Decoder->initFromPath() #1 /www/wwwroot/tc/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(66): Intervention\\Image\\AbstractDecoder->init() #2 /www/wwwroot/tc/vendor/intervention/image/src/Intervention/Image/ImageManager.php(54): Intervention\\Image\\AbstractDriver->init() #3 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Intervention\\Image\\ImageManager->make() #4 /www/wwwroot/tc/app/Services/ImageService.php(504): Illuminate\\Support\\Facades\\Facade::__callStatic() #5 /www/wwwroot/tc/app/Services/ImageService.php(175): App\\Services\\ImageService->stickWatermark() #6 /www/wwwroot/tc/app/Http/Controllers/Controller.php(129): App\\Services\\ImageService->store() #7 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\Controller->upload() #8 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction() #9 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\\Routing\\ControllerDispatcher->dispatch() #10 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\\Routing\\Route->runController() #11 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\\Routing\\Route->run() #12 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}() #13 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #14 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle() #15 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #16 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle() #17 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #18 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle() #19 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #20 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest() #21 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle() #22 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #23 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle() #24 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #25 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle() #26 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #27 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\\Pipeline\\Pipeline->then() #28 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\\Routing\\Router->runRouteWithinStack() #29 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\\Routing\\Router->runRoute() #30 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\\Routing\\Router->dispatchToRoute() #31 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch() #32 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}() #33 /www/wwwroot/tc/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #34 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle() #35 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #36 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #37 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle() #38 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #39 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #40 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle() #41 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #42 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle() #43 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #44 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle() #45 /www/wwwroot/tc/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #46 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Fruitcake\\Cors\\HandleCors->handle() #47 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #48 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle() #49 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #50 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then() #51 /www/wwwroot/tc/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter() #52 /www/wwwroot/tc/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle() #53 {main}"}
今天排查了下,开启水印功能后上传webp格式就会报这个错,关掉水印后可正常上传
开启文件格式转换到webp格式,开启水印时上传别的格式的图片,也正常,单单上传webp格式有问题,请问如何解决
https://docs.lsky.pro/docs/enterprise/v1/others/imagick.html
使用php --ri imagick查看 是支持webp格式的
https://docs.lsky.pro/docs/enterprise/v1/others/imagick.html 使用此方法也不可以
具体的报错信息如下