[QGIS-trac] Re: [Quantum GIS] #3295: SVG images rasterized when printing/exporting

Quantum GIS qgis at qgis.org
Tue Dec 21 19:46:06 EST 2010


#3295: SVG images rasterized when printing/exporting
--------------------------------+-------------------------------------------
   Reporter:  Alister           |              Owner:  nobody       
       Type:  bug               |             Status:  new          
   Priority:  minor: annoyance  |          Milestone:  Version 1.7.0
  Component:  Printing          |            Version:  Trunk        
   Keywords:                    |   Platform_version:               
   Platform:  Windows           |           Must_fix:  No           
Status_info:  0                 |  
--------------------------------+-------------------------------------------

Comment(by JD):

 Attaching a patch to fix this bug/feature.

 The QgsComposerPicture was rendering the SVG into a QImage cache and then
 drawing that image. As QgsComposerPicture is a scene item, it meant that
 it was never treated as a vector by Qt.

 QgsComposerPicture now has a QSvgRenderer member variable as well as the
 QImage that is used for bitmaps. It now performs no caching of the SVG,
 instead relying on Qt to draw it in the most efficient way. Indeed, the
 refresh rate for a native SVG _seems_ much quicker than the cached QImage
 version, but no timing tests have been done.

 As a knock-on effect PDF and SVG export now treat SVGs as vectors rather
 than rasters.

 An arguably more efficient approach would be to use a QPicture to render
 either a vector or a raster into. This has the advantage that the only
 time a distinction is made between the two is on loading, thereby
 simplifying the code and removing a redundant member variable.

 -JD

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/3295#comment:3>
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