Bug report #8272

Bad size request with a georeferenced raster

Added by Hugo Mercier over 11 years ago. Updated over 5 years ago.

Status:Rejected
Priority:Normal
Assignee:-
Category:Rasters
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17075

Description

With some georeferenced rasters (for instance a jpeg file with a .jgw world file), visual artifacts may appear on some zoom levels.

Steps to reproduce :
  • load the raster found in attachment (do not forget to copy the .jgw file in the same directory)
  • move it to the top left corner of the canvas, with some space not visible
  • extent the canvas window until you see glitches. You can find examples in attachment also.

When these visual artifacts occur, a GDAL error is displayed on the console :
Warning: RasterIO error1: /home/hme/Bureau/atlas/test.jpeg, band 2: Access window out of range in RasterIO(). Requested
(77,626) of size 3431x1854 on raster of 3507x2480.

Indeed there is an off-by-one size calculation somewhere in qgsgdalprovider.cpp

The problem is apparently due to a not very well-formatted world file : some of its constants do not exhibit enough decimals (first and fourth line for instance).

I suspect some strange rounding errors for now ...

test.jpeg (358 KB) Hugo Mercier, 2013-07-11 01:24 PM

test.jgw (52 Bytes) Hugo Mercier, 2013-07-11 01:24 PM

raster_bug1.png (183 KB) Hugo Mercier, 2013-07-11 01:24 PM

raster_bug2.png (168 KB) Hugo Mercier, 2013-07-11 01:24 PM

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Hugo Mercier over 5 years ago

  • Status changed from Open to Rejected
  • Description updated (diff)

Can't reproduce on 3.5. closing

Also available in: Atom PDF