Bug report #16546

exporting a raster layer with multiply blend mode with a dpi settings > 96 fails

Added by Mathieu Pellerin - nIRV over 4 years ago. Updated over 4 years ago.

Status:Closed
Priority:High
Assignee:Mathieu Pellerin - nIRV
Category:Rasters
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24452

Description

Exporting a raster layer with a blend mode set to multiply fails to render properly for an output dpi that is greater than 96 dpi. The exported image results in a raster layer that blends only part of its full area (the part being equivalent to what the size would be in 96 dpi). It's a bit hard to explain, but the attached screenshot (300.jpg) should do a good job at showing the issue.

Steps to reproduce
  1. Open the raster-blending-bug test project (get it here: http://www.licadho-cambodia.org/raster-blending-bug.zip)
  2. Save the canvas as an image, set the output dpi to 300
  3. Open the exported image, take note of the issue :)

300.jpg (212 KB) Mathieu Pellerin - nIRV, 2017-05-13 06:40 AM

96dpi-ok.jpg (58.8 KB) Mathieu Pellerin - nIRV, 2017-05-13 09:49 AM

300dpi-bad.jpg (236 KB) Mathieu Pellerin - nIRV, 2017-05-13 09:49 AM

300dpi-semi.jpg (265 KB) Mathieu Pellerin - nIRV, 2017-05-13 10:01 AM

Associated revisions

Revision 93c59f4e
Added by Mathieu Pellerin - nIRV over 4 years ago

[raster] fix raster blending (fixes #16546)

History

#1 Updated by Mathieu Pellerin - nIRV over 4 years ago

Here's a pair of exported images that shows the problem a bit better. It's clear that the 300dpi export has part of the image below the raster layer chopped off.

#2 Updated by Mathieu Pellerin - nIRV over 4 years ago

Hmm, if I add some transparency to the multiply blend raster layer, it shows part of the underlying background.

So what seems to happen here is that the blend mode doesn't respect / account for the output dpi. That looks more and more like a Qt issue :/

#3 Updated by Mathieu Pellerin - nIRV over 4 years ago

  • Resolution set to up/downstream
  • Status changed from Open to Closed

The area that's properly blended is a fixed 2000 px x 2000px, I'm closing this now concluding it's an issue with regards to the underlying Qt library.

#4 Updated by Mathieu Pellerin - nIRV over 4 years ago

  • Resolution deleted (up/downstream)
  • Status changed from Closed to Reopened

Change of mind. 2000 x 2000 pixels happens to be this raster related with n height constant:

static const int DEFAULT_MAXIMUM_TILE_WIDTH = 2000;
static const int DEFAULT_MAXIMUM_TILE_HEIGHT = 2000;

That, and the fact that I can't see any problem with vector layers (eg a polygon covering the whole output area) points out at a problem in QGIS instead.

#5 Updated by Mathieu Pellerin - nIRV over 4 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Priority changed from Normal to High
  • Regression? changed from No to Yes
  • Assignee set to Mathieu Pellerin - nIRV

Issue located, patch coming to github in the coming hour.

#6 Updated by Mathieu Pellerin - nIRV over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Reopened to Closed

#7 Updated by Giovanni Manghi over 4 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF