Upgraded to gdal 1.10 and still the same problem when writing JP2 files.
It still fails at
oError = CNCSJP2FileView::Open( &(m_OStream) );
in ecwcreatecopy.cpp.
I think the problem comes with the way ERDAS library handles m_OStream.
I commented this block just before trying to open the output file:
// if( bIsJPEG2000 )
// {
// int bSeekable = !
// ( strncmp(pszFilename, "/vsistdout/", strlen("/vsistdout/")) ==
0 ||
// strncmp(pszFilename, "/vsizip/", strlen("/vsizip/")) == 0 ||
// strncmp(pszFilename, "/vsigzip/", strlen("/vsigzip/")) == 0
);
// fpVSIL = VSIFOpenL( pszFilename, (bSeekable) ? "wb+": "wb" );
// if( fpVSIL == NULL )
// {
// CPLError( CE_Failure, CPLE_OpenFailed,
// "Failed to open %s.", pszFilename );
// return CE_Failure;
// }
// m_OStream.Access( fpVSIL, TRUE, bSeekable, pszFilename, 0, -1 );
// }
which makes it fall in
oError = Open( (char *) pszFilename, false, true );
instead and works perfectly.
What is the benefit of using m_OStream? and could you confirm that the same
problem occurs with you?
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Cannot-write-jpeg2000-with-ERDAS-4-3-tp5040505p5058290.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev