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)
5
  • 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
    Commented Mar 16, 2017 at 14:50
  • just add raster layers that can i do with plugin,why joseph any idea ?ys its QGIS 2.18.3 Commented Mar 16, 2017 at 19:09
  • what mean QGIS with this error ?where is the proplem ? Commented Mar 16, 2017 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
    Commented Mar 17, 2017 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? Commented Mar 17, 2017 at 18:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.