<div dir="ltr">Hello all,<div><br></div><div>I'm hitting my head on a wall trying to get the absolute path of a file.py in order to load a logo in a shortHelpString as shown below. </div><div>      <span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(156,220,254)">dir_name</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre"> </span><span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(212,212,212)">=</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre"> (</span><span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(78,201,176)">os</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre">.</span><span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(156,220,254)">path</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre">.</span><span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(220,220,170)">dirname</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre">(</span><span style="background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre;color:rgb(156,220,254)">__file__</span><span style="background-color:rgb(31,31,31);color:rgb(204,204,204);font-family:Menlo,Monaco,"Courier New",monospace;font-size:24px;white-space:pre">))</span></div><div>        script_path = os.path.abspath(inspect.getfile(inspect.currentframe()))<br>        script_dir = os.path.dirname(script_path)<br>        logo_path = (os.path.join(script_dir, 'logo.png'))<br>        print(f"logo_path: {logo_path}")<br>        logoPath = "/Users/juliermegp/Library/Application Support/QGIS/QGIS3/profiles/default/processing/scripts/logo.png"</div><div><br></div><div>return f"""<br>        <h2>Example Algorithm</h2><br>        <p>This algorithm demonstrates the use of a relative path to include an image in the help description.</p><br>        <h3>Parameters</h3><br>        <ul><br>            <li><b>Input Raster Layer:</b> The raster layer to be processed.</li><br>            <li><b>Output Raster Layer:</b> The resulting processed raster layer.</li><br>        </ul><br>        <h3>Usage</h3><br>        <p>To use this algorithm, select the input raster layer and specify the desired output location for the processed raster layer.</p><br>        <h3>Image Example</h3><br>        <p>The following image provides an example of the expected output:</p><br>        <img src="{image_url}" alt="Example Output Image" /><br>        <h3>Notes</h3><br>        <p>Ensure that the image file (example_output.png) is placed in the relative path <code>images/</code> within the plugin directory. This path is relative to the location of the algorithm script.</p><br clear="all"><div><br></div><div>According to the variables above, only logoPath works the other ones don't. Could someone tell me why I can't get the absolute file using __file__? Could you give me a direction on how to achieve that? The script runs inside the scripts directory in QGIS directory. </div><div><br></div><div>Thank you for your time in advance.</div><div><br></div><div>Julierme</div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font face="verdana, sans-serif">##########################################</font></div><font size="4" face="verdana, sans-serif"><b><font color="#20124d">Julierme G Pinheiro</font></b><br><b><font color="#660000">SDI Expert & Geoprocessing Specialist</font></b></font><div><font size="4" face="verdana, sans-serif"><font color="#351c75">Phone:</font> <font color="#444444">+55 61 99994-3569</font></font></div><div><font size="4" face="verdana, sans-serif"><font color="#351c75">Website:</font> <a href="https://www.udemy.com/course/qgis-server-para-iniciantes-instalacao-e-configuracao/" target="_blank">GIS</a></font></div></div></div></div></div>