Opened 10 years ago

Closed 10 years ago

#5313 closed defect (fixed)

Minor cleanup of ECW driver error message

Reported by: Kurt Schwehr Owned by: Kurt Schwehr
Priority: normal Milestone: 1.10.2
Component: default Version: unspecified
Severity: normal Keywords: ecw
Cc:

Description

Could someone let me know if this is good to go or if it needs alternation? Thanks!

If an ECW file has too many bands, it would be nice to say what that max is in the error message. And since I'm not experienced naming variables in gdal, I'm waiting for this ticket on the 1.10 branch before committing to trunk. Adds a constant for the maximum number of bands and report it in the ReportError call.

source:trunk/gdal/frmts/ecw/ecwdataset.cpp#L1498

    const int nBandsMax = 100;
    if( nBandCount > nBandsMax )
    {
        ReportError( CE_Failure, CPLE_IllegalArg,
                     "AdviseRead(): Too many bands (max: %d): %d",
                     nBandsMax, nBandCount);
        return CE_Failure;
    }

Change History (3)

comment:1 by Even Rouault, 10 years ago

If you feel changing the message is necessary, just do it. Not sure to understand what you meant about 1.10 vs trunk: usually the procedure is to commit first in trunk, and backport in 1.10 if necessary (honnestly, I fail to see why you would want to change the message in 1.10, but that would be fine too)

What is more interesting to know is if you reached the limit in a real world case, or if it is just by code inspection. If it is a real world case, removing the hard-coded limit might be more interesting. This 100 limit is also found at line 1770 and 1924

comment:2 by Kurt Schwehr, 10 years ago

Have not hit this yet. Just starting out in the land of ECW images.

comment:3 by Kurt Schwehr, 10 years ago

Resolution: fixed
Status: newclosed

r26082 does this. closing.

Note: See TracTickets for help on using tickets.