[QGIS-trac] Re: [Quantum GIS] #1945: [Vista] Qgis crashes removing
GRASS raster layer from map canvas
Quantum GIS
qgis at qgis.org
Sat Feb 6 07:21:03 EST 2010
#1945: [Vista] Qgis crashes removing GRASS raster layer from map canvas
--------------------------------------------------------------+-------------
Reporter: juanelz | Owner: rugginoso
Type: bug | Status: closed
Priority: critical: causes crash or data corruption | Milestone: Version 1.5.0
Component: GRASS | Version: HEAD
Resolution: fixed | Keywords: GRASS rasters
Platform_version: Vista | Platform: Windows
Must_fix: Yes | Status_info: 0
--------------------------------------------------------------+-------------
Comment (by rblazek):
Replying to [comment:26 lutra]:
> Screenshot-1.png
Nice, unfortunately i works for me both on ubuntu and xp.qgis.d.rast reads
the raster row by row and for each cell prints to output BGRA (4 bytes) or
ARGB (for big endian). QGIS reads everything and sets the QImage data with
memcpy. It is a bit tricky, I used that way to get higher performance and
well, also to enjoy it and get such a nice images. I could use idiotproof
setPixel() but it would be too easy.
Does it displays always with the same colors or they are random?
You can tests qgis.d.rast directly from GRASS shell to see if the output
is correct specifying window=xmin,ymin,xmax,ymax,ncols,nrows and pass it
either to od, example:
{{{
/home/radim/apps/share/qgis/grass/modules/qgis.d.rast map=pok at demo
window=-6.85857e+06,2.25129e+06,3.172e+06,7.79079e+06,10,10 | od -w40 -tx4
}}}
unfortunately support for bgra in imagemagic is too recent and I dont know
how to change byte order from command line.
Then you can replace the qgis.d.rast with a script like this
{{{
#!/usr/bin/perl
for($i=0;$i<100000;$i=$i+1){
printf "%c%c%c%c", 255, 0, 0, 255;
}
}}}
to see if QGIS takes colors correctly.
Size of integer and byte order could also be involved but I don't see how,
I have checked that QImage is realy using uchar and the image size is
correct.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1945#comment:27>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list