librephotos
librephotos copied to clipboard
Scanner crashes with Field 'digitalZoomRatio' expected a number but got 'undef'.
On a freshly refreshed install
🐛 Bug Report
could not load image XXXXX . reason: Field 'digitalZoomRatio' expected a number but got 'undef'.
What Operating system and version is LibrePhotos running on:
Debian Linux
What architecture is LibrePhotos running on:
x64
How is LibrePhotos installed:
Docker
If running via Docker or Kubernetes please list version including docker-compose:
2022w29
Are you running LibrePhotos on a virtual machine if so please list:
How is you picture library mounted on the host (or in the virtual machine):
Local file system zfs
Description of issue:
Photo scanner process crashes with the following error is:issue is:open could not load image XXXXX . reason: Field 'digitalZoomRatio' expected a number but got 'undef'.
How can we reproduce it:
Additional Information:
ERROR:ownphotos:job 2e46e36f-465d-45c4-8535-eea28208c09f: could not load image /data/cimg5131.jpg. reason: Field 'digitalZoomRatio' expected a number but got 'undef'. ESC[36mbackend_1 |ESC[0m Traceback (most recent call last): ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/fields/init.py", line 1687, in get_prep_value ESC[36mbackend_1 |ESC[0m return float(value) ESC[36mbackend_1 |ESC[0m ValueError: could not convert string to float: 'undef' ESC[36mbackend_1 |ESC[0m ESC[36mbackend_1 |ESC[0m The above exception was the direct cause of the following exception: ESC[36mbackend_1 |ESC[0m ESC[36mbackend_1 |ESC[0m Traceback (most recent call last): ESC[36mbackend_1 |ESC[0m File "/code/api/directory_watcher.py", line 245, in rescan_image ESC[36mbackend_1 |ESC[0m photo._extract_exif_data(True) ESC[36mbackend_1 |ESC[0m File "/code/api/models/photo.py", line 539, in _extract_exif_data ESC[36mbackend_1 |ESC[0m self.save() ESC[36mbackend_1 |ESC[0m File "/code/api/models/photo.py", line 134, in save ESC[36mbackend_1 |ESC[0m return super().save( ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py", line 753, in save ESC[36mbackend_1 |ESC[0m self.save_base(using=using, force_insert=force_insert, ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py", line 790, in save_base ESC[36mbackend_1 |ESC[0m updated = self._save_table( ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py", line 872, in _save_table ESC[36mbackend_1 |ESC[0m updated = self._do_update(base_qs, using, pk_val, values, update_fields, ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py", line 926, in _do_update ESC[36mbackend_1 |ESC[0m return filtered._update(values) > 0 ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/query.py", line 803, in _update ESC[36mbackend_1 |ESC[0m return query.get_compiler(self.db).execute_sql(CURSOR) ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/sql/compiler.py", line 1522, in execute_sql ESC[36mbackend_1 |ESC[0m cursor = super().execute_sql(result_type) ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/sql/compiler.py", line 1143, in execute_sql ESC[36mbackend_1 |ESC[0m sql, params = self.as_sql() ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/sql/compiler.py", line 1488, in as_sql ESC[36mbackend_1 |ESC[0m val = field.get_db_prep_save(val, connection=self.connection) ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/fields/init.py", line 823, in get_db_prep_save ESC[36mbackend_1 |ESC[0m return self.get_db_prep_value(value, connection=connection, prepared=False) ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/fields/init.py", line 818, in get_db_prep_value ESC[36mbackend_1 |ESC[0m value = self.get_prep_value(value) ESC[36mbackend_1 |ESC[0m File "/usr/local/lib/python3.9/dist-packages/django/db/models/fields/init.py", line 1689, in get_prep_value ESC[36mbackend_1 |ESC[0m raise e.class( ESC[36mbackend_1 |ESC[0m ValueError: Field 'digitalZoomRatio' expected a number but got 'undef'. .
note: does not happen for all pictures, so likely just needs error handling
This should only happen on the dev image. I pushed a fix for it yesterday. Could you test it? If this didn't fix it, it would be great if you could send me the photo that causes this issue.