[Gdal-dev] Error 4 problem

Frank Warmerdam warmerdam at pobox.com
Fri Apr 16 01:33:06 EDT 2004


Tan Meng Howe wrote:
> Hi all,
> 
> I was trying out gdal with jasper (both are the latest
> version downloadable from gdal website) on windows XP
> using VC6. I was able to compile successful. However,
> when I tried to use the gdal_translate program to
> convert from a tif to a jpeg2000, I got the following
> error:
> 
> Error 4: 'test.jp2' not recognised as a supported file
> format. 

Hi,

Is the newest version the nightly snapshot or the 1.2.0
release.  Did you also build with ECW support?  I just ask
because the current CVS code will always try the ECW DLL
for JPEG2000 files even if using an older ECW DLL without jpeg2000
support.

Does gdalinfo work on existing jpeg2000 files?  Does the new
jpeg2000 file seem OK?  Can anything else view it?  Does the JPEG2000
format driver show up if you try "gdalinfo --formats"?

> I had also tried writing a DLL that call the GDAL DLL.
> When I tried to execute my DLL (using a java program
> through JNI), I got the same error when I tried to use
> the GDALOpen function to load a tif file.
> 
> I suspected that I need to tweak some compiler setting
> to solve the problem. Have anyone here face this
> problem before and manage to solve it? Thanks. 

My first guess would be that the JPEG2000 driver isn't being registered.
But if you can create the jpeg2000 files with gdal_translate then that
isn't the issue.  You might need to provide additional details.  You also
might want to put a few printf() calls in JPEG2000Dataset::Open() just before
and after the jas_stream_fopen() call to see that things are even getting to
the right spot.   That is in the gdal/frmts/jpeg2000/jpeg2000dataset.cpp
file.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list