3

I have created a simple QGIS script using QGIS 2.18.3 and windows 10 and it works fine without errors.But I want to move that script to another PC where I have QGIS 2.6 and windows 7.

I first copy-paste my plugin in .qgis2 to the other PC and QGIS loads this script without errors but if try to execute the script then I take that error :

minidump written to C:
\users\username\AppData\Local\Temp\qgis-20170316-131340-2756-3012-e2a51df.dmp

Any idea why? In the plugin I have more pushbutton where show some details that button works but it doesn't work in the final execute? Maybe it's the Windows user's permission?

UPDATE : PLUGIN CODE

my plugin is simple for test:

    fileInfo = QFileInfo(input)
    baseName = fileInfo.baseName()      
    filePath = str(os.path.abspath(input))      
    rlayer = QgsRasterLayer(filePath, baseName)

or i try that code from this post:

from qgis.core import QgsRasterLayer
from PyQt4.QtCore import QFileInfo

def StringToRaster(raster):
    # Check if string is provided

    fileInfo = QFileInfo(raster)
    path = fileInfo.filePath()
    baseName = fileInfo.baseName()

    layer = QgsRasterLayer(path, baseName)
    QgsMapLayerRegistry.instance().addMapLayer(layer)

    if layer.isValid() is True:
        print "Layer was loaded successfully!"

    else:
        print "Unable to read basename and file path - Your string is probably invalid"


raster = '/home/zeito/Desktop/output2.tif'

StringToRaster(raster)
  • What does your plugin do? Perhaps it uses features which are available in (I'm guessing it's QGIS 2.18.3 and not 18.3?) but not available in 2.6? – Joseph Mar 16 '17 at 14:50
  • just add raster layers that can i do with plugin,why joseph any idea ?ys its QGIS 2.18.3 – Chris Papas Mar 16 '17 at 19:09
  • what mean QGIS with this error ?where is the proplem ? – Chris Papas Mar 16 '17 at 19:19
  • It could be a number of things, can you isolate which part of your plugin fails and edit your question to include the code? This could help potential answerers :) – Joseph Mar 17 '17 at 10:33
  • that error i take every to try import '.tif' rasters layers with some changes in my code i can to import '.jpg' and '.png' but not '.tif' images,that is bug from QGIS ?@Joseph? – Chris Papas Mar 17 '17 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.