QField icon indicating copy to clipboard operation
QField copied to clipboard

Support positioning functions in attachment file name expressions

Open cruelaid opened this issue 1 year ago • 1 comments

Describe the issue

Positioning functions such as @gnss_orientation do not work as expected within the attachment naming expression.

Reproduction steps

Steps to reproduce the behavior:

  1. Setup a geometry layer in QGIS with a field for attachments.
  2. In the Qfield tab of the layer properties, use 'DCIM/layer_' || @gnss_orientation || '.{extension}' or a similar expression as the attachment naming scheme.
  3. Open the project in Qfield and use the camera widget to snap a photo
  4. View the file name of the photo.

Expected behavior

The file should have a name such as layer_25.416004835.jpg

Observed behavior

The image name reverts to the default naming scheme, indicating an error or null value in the expression.

Desktop (please complete the following information)

  • OS: Windows
  • QGIS Version 3.38.0
  • QFieldSync Version 4.9.1

Mobile (please complete the following information)

  • Device: Samsung Galaxy A13
  • OS: Android 14
  • QField version: 3.3.6 (78a4fe)

Additional information

Storing the device's orientation at the moment the photo is taken is useful for a variety of applications. Extracting exif data from photos taken with the Open Camera app used to be the way to do this, but the app is apparently unable to interact with Qfield as of Android 11. Qfield's built-in camera and many native cameras also do not appear to store this exif data. Merely creating a field with @gnss_orientation as the default value would store the device orientation when the feature was added, not when the photo was taken. An alternative solution would be to add the exif data to Qfield's built-in camera widget.

cruelaid avatar Jul 17 '24 02:07 cruelaid

@cruelaid , transformed that into an enhancement request, it is indeed the case that the attachment file naming does not yet support positioning (and qfieldcloud) scopes.

nirvn avatar Jul 20 '24 05:07 nirvn

@cruelaid , implemented in QField 3.6

nirvn avatar May 27 '25 07:05 nirvn