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

ExifMetadataProvider.php Doesn't Handle Unexpected Data Well #2635

Open
nmbgeek opened this issue Sep 6, 2024 · 0 comments
Open

ExifMetadataProvider.php Doesn't Handle Unexpected Data Well #2635

nmbgeek opened this issue Sep 6, 2024 · 0 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@nmbgeek
Copy link
Contributor

nmbgeek commented Sep 6, 2024

Describe the bug
Parsing of GPS data needs to be improved for files with various metadata issues

To Reproduce
Steps to reproduce the behavior:
Upload a file with missing or non-standard GPS metadata

Expected behavior
Handle the missing metadata gracefully

Desktop (please complete the following information):

  • Server side error and UI hangs.
#2541 contains an image that will hang the UI when uploading due to non-standard metadata #2260 - The main issue may or may not be addressed by the pull request I will be uploading but many of the other respondents will be.

My error which is mentioned under #2260 but not identical to the main issue there.

{"reqId":"6l46zUo5lYmwpGUt04cf","level":2,"time":"2024-09-06T07:50:48-04:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Error while generating metadata for fileid 44098","userAgent":"--","version":"29.0.6.1","exception":{"Exception":"TypeError","Message":"count(): Argument #1 ($value) must be of type Countable|array, null given","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php","line":130,"function":"count"},{"file":"/var/www/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php","line":109,"function":"gpsDegreesToDecimal","class":"OCA\\Photos\\Listener\\ExifMetadataProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\\Photos\\Listener\\ExifMetadataProvider","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php","line":114,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":126,"function":"refreshMetadata","class":"OC\\FilesMetadata\\FilesMetadataManager","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":109,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":109,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":98,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":84,"function":"scanFilesForUser","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":177,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php","Line":130,"message":"Error while generating metadata for fileid 44098","exception":[],"CustomMessage":"Error while generating metadata for fileid 44098"},"id":"66daed2173aba"}
@nmbgeek nmbgeek added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant