Skip to content

Commit

Permalink
Fix img href link address
Browse files Browse the repository at this point in the history
Refs #36
  • Loading branch information
nyalldawson committed Aug 20, 2019
1 parent ff194a9 commit 8c330bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions processing_r/processing/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
QgsVectorFileWriter,
QgsVectorLayer,
QgsProcessingUtils)
from qgis.PyQt.QtCore import QCoreApplication, QDir
from qgis.PyQt.QtCore import (
QCoreApplication,
QDir,
QUrl
)
from processing.core.parameters import getParameterFromString
from processing_r.processing.outputs import create_output_from_string
from processing_r.processing.utils import RUtils
Expand Down Expand Up @@ -306,7 +310,7 @@ def processAlgorithm(self, parameters, context, feedback):
html_filename = self.parameterAsFileOutput(parameters, RAlgorithm.RPLOTS, context)
if html_filename:
with open(html_filename, 'w') as f:
f.write('<html><img src="' + self.plots_filename + '"/></html>')
f.write('<html><img src="{}"/></html>'.format(QUrl.fromLocalFile(self.plots_filename).toString()))
self.results[RAlgorithm.RPLOTS] = html_filename
if self.show_console_output:
html_filename = self.parameterAsFileOutput(parameters, RAlgorithm.R_CONSOLE_OUTPUT, context)
Expand Down

0 comments on commit 8c330bb

Please sign in to comment.