3

(Windows 10.1 and QGIS 2.18)

I am trying to create an action for a Shapefile layer that will display an image when any of its three polygons are clicked.

I have added an "image" field to the layer's attribute table, and changed it to "File Name" type, so that each of the layer's polygons has an image associated with it.

I then went to layer properties > actions and created the action as shown in the screenshot below.

enter image description here

But when I tried to click on one of the layer's polygons, I got the following error:

"Unable to run command open C:/Users/******/Downloads/QGIS-Training-Data-QGIS-Training-Data-v1.0/training_manual_data/school_property_photos/rugby_field.jpg"

I tried to find what I had done wrong, but as far as I could see, I had done everything right. I tried to research but found nothing helpful. I tried to restart both QGIS and my PC but I still got the same error.

2

From your image, change the Type from Generic to Open.

This should open the url path and if it points to an image file, it should load the file into an image editor.

  • I tried that, but it didn't work. Thanks so much anyway! – user95155 Apr 21 '17 at 11:31
  • @Tookie345 - Do you receive an error? Also, you don't need to change the File Type for actions, you can leave it as a Text Edit. But the linked post also contains useful answers :) – Joseph Apr 21 '17 at 11:36
  • I know, the answer on that post fixed my problem for me – user95155 Apr 21 '17 at 15:13