roam-qgis / Roam

Simple data collection built using QGIS.
http://roam-docs.readthedocs.org/en/latest/
GNU General Public License v2.0
171 stars 61 forks source link

Feature Selection: Images do not display in attribute list if saved to file #476

Open HeatherHillers opened 3 years ago

HeatherHillers commented 3 years ago

On a fresh pull of the master, and also in release 3.0.6:

In a new project created by the Config Manager:

Create 2 new (spatialite db) layers. Each has an image widget in its form.

In one layer, check the box to save the image to _images directory.

In the other layer, let the image be stored in the database.

Open in Roam and add features to both layers.

Select the features.

In the layer where the image is saved to the database, the image is visible in the attribute list.

In the layer where the image is saved to file, the image shows as a broken link in the attribute list.

In both cases, the image is visible when the data entry widget is opened.

HeatherHillers commented 3 years ago

The problem seems to occur in src/roam/infodock.py:create_data_html:642 where the html for the image is set. The function is not aware that the current attribute was saved to file, and in both cases uses the plain attribute value as a src in the image tag. The configuration for the fields would have to be passed to the function in order to add the image directory to the tag when its appropriate.