Opened 17 years ago

Closed 15 years ago

#1860 closed defect (fixed)

[PATCH] JPG JGW files with blank lines not recognized

Reported by: Arkygeek Owned by: Even Rouault
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: worldfile jpg jgw
Cc: warmerdam, Even Rouault, Mateusz Łoskot

Description

At the moment, if the .jgw file contains blank lines, you must manually remove them before gdal recognizes them as valid.

Attachments (3)

35E32N_G.JGW (153 bytes ) - added by Even Rouault 17 years ago.
test case
35E32N_G.2.JGW (153 bytes ) - added by Even Rouault 17 years ago.
test case
gdal_svn_trunk_wld_with_blk_lines_bug1860.patch (2.5 KB ) - added by Even Rouault 17 years ago.

Download all attachments as: .zip

Change History (10)

by Even Rouault, 17 years ago

Attachment: 35E32N_G.JGW added

test case

by Even Rouault, 17 years ago

Attachment: 35E32N_G.2.JGW added

test case

comment:1 by Even Rouault, 17 years ago

I'm enclosing a patch that fixes the issue.

comment:2 by warmerdam, 17 years ago

Cc: warmerdam Even Rouault added
Component: defaultGDAL_Raster
Keywords: worldfile added
Owner: changed from warmerdam to Mateusz Łoskot
Version: unspecifiedsvn-trunk

We have a previous bug report on this issue, and the solution at the time was to just treat world files with blank lines as invalid. Mateusz, I think that was yours? Could you dig up the reference and reference here?

I would like to understand more about what software generates world files with blank lines, and why. Are they always in the specific form given in the first example?

I'm not against Even's suggested patch but I worry that we are "reaching" to much and may end up interpreting garbage files as world files.

comment:3 by Even Rouault, 17 years ago

In fact this was reported on #gdal on IRC yesterday by arkygeek and he mentionned that it came from http://gaialab.asu.edu/Jordan/SL50k/35e32n_g.zip (main page : http://gaialab.asu.edu/Jordan/)

I tried the jpeg and jgw from 35e32n_g.zip with GlobalMapper8 and it was able to understand the jgw. So, it's not like as if GDAL would try to be cleverer than other existing GIS... We could imagine also issuing a warning when we detect blank lines to make the user aware that its worldfile may be not understood by other GIS.

Out of curiosity, I've taken a look at readWorldFile from mapserver/mapraster.c and it blindly assumes that there are 6 non-empty lines. So, should we consider extending readWorldFile too if we extend GDALReadWorldFile ?

I think the previous bug report you're mentionning was #1523.

comment:4 by Even Rouault, 17 years ago

Here there are a few more details on how this dataset was produced.

Just of curiosity, I've searched GlobalMapper release notes and could see the following entries :

  • Added support for reading coordinates from world files where the coordinates are separated with tabs rather than being on separate lines.
  • Added automatic detection of world files that have an extra .txt appended to the filename.

comment:5 by Even Rouault, 17 years ago

Summary: JPG JGW files with blank lines not recognized[PATCH] JPG JGW files with blank lines not recognized

comment:6 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Keywords: jpg jgw added
Owner: changed from Mateusz Łoskot to Even Rouault

comment:7 by warmerdam, 15 years ago

Resolution: fixed
Status: newclosed

This change has been incorporated as part of a merge of ESRI changes in trunk (r17121).

Note: See TracTickets for help on using tickets.