Skip to content
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

[Enhancement] Catch exceptions for individual photos so that it will not stop syncing of large photo library #592

Closed
zhanglix opened this issue May 23, 2020 · 1 comment · Fixed by #1217

Comments

@zhanglix
Copy link
Contributor

Lychee may fail to process some photos in a large set of photos for various reasons such as corrupted photo, exceptional boundary condition.

Current, Gdhandler->crop() did not catch all exceptions so that it will stop the whole syncing procedure. And It is very difficult and tediously to location the photos which caused the exception.

It will be really nice if Lychee can skip and record photos which can not be processed and keep syncing other photos.

ErrorException: getimagesize(): Read error! in /var/www/html/Lychee/app/Image/GdHandler.php:145
Stack trace:                                                                                                                                                                                                
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'getimagesize():...', '/var/www/html/L...', 145, Array)                                                            
#1 /var/www/html/Lychee/app/Image/GdHandler.php(145): getimagesize('/tmp/lycheeTPvv...')                                                                                                                    
#2 /var/www/html/Lychee/app/Image/ImageHandler.php(59): App\Image\GdHandler->crop('/tmp/lycheeTPvv...', '/var/www/html/L...', 200, 200)                                                                     
#3 /var/www/html/Lychee/app/ModelFunctions/PhotoFunctions.php(547): App\Image\ImageHandler->crop('/tmp/lycheeTPvv...', '/var/www/html/L...', 200, 200)                                                      
#4 /var/www/html/Lychee/app/ModelFunctions/PhotoFunctions.php(411): App\ModelFunctions\PhotoFunctions->createThumb(Object(App\Photo), '/tmp/lycheeTPvv...')                                                 
#5 /var/www/html/Lychee/app/Http/Controllers/ImportController.php(81): App\ModelFunctions\PhotoFunctions->add(Array, 1589660971, false, true)                                                               
#6 /var/www/html/Lychee/app/Http/Controllers/ImportController.php(369): App\Http\Controllers\ImportController->photo('/conf/sync/zhan...', false, 1589660971, true)                                         
#7 /var/www/html/Lychee/app/Http/Controllers/ImportController.php(405): App\Http\Controllers\ImportController->server_exec('/conf/sync/zhan...', 1589660971, false, true, NULL)                             
#8 /var/www/html/Lychee/app/Http/Controllers/ImportController.php(405): App\Http\Controllers\ImportController->server_exec('/conf/sync/zhan...', 1589650651, false, true, NULL)                             
#9 /var/www/html/Lychee/app/Console/Commands/Sync.php(85): App\Http\Controllers\ImportController->server_exec('/conf/sync/zhan...', 0, false, true)                                                         
#10 [internal function]: App\Console\Commands\Sync->handle()                                                                                                                                                
#11 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(33): call_user_func_array(Array, Array)                                                                          
#12 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()                                                 
#13 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(91): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))                                                 
#14 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#15 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Container/Container.php(592): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)        
#16 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call(Array)                                                                      
#17 /var/www/html/Lychee/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))    
#18 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#19 /var/www/html/Lychee/vendor/symfony/console/Application.php(912): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/Lychee/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\Sync), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/html/Lychee/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/html/Lychee/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))               
#25 {main}  
@nagmat84
Copy link
Collaborator

Proper exception handling is finally implemented by the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants