Page 1 of 1

Can't read a .jp2 file

Posted: Thu Oct 28, 2010 7:43 am
by MihGer
Small VB program:

Code: Select all

Dim oConvert As New GflAx.GflAx
oConvert.SetPluginsPathname = "C:\Program Files\GflSDKGflAx\Lib\plugins\"
Call oConvert.LoadBitmap("C:\test.jp2")
oConvert.SaveFormatName = "bmp"
Call oConvert.SaveBitmap("C:\test.bmp")
Result:
An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication1.exe

Additional information: Object reference not set to an instance of an object.
at the LoadBitmap string.
Reading from another format is ok, saving to .jp2 format is ok too.
.jp2 file was written by GflAx and can be easily opened by QuickTime, so problem is not in a file I suppose.

Re: Can't read a .jp2 file Problem solved- BAD plugin DLL!!!

Posted: Sat Oct 30, 2010 2:35 pm
by MihGer
I've found another Xjp2.dll plugin from old XnView installation on my friend's computer and tried to used it. To my great surprise IT IS WORKING! :shock:
So the problem is obviously in plugin dll

P.S. I've attched the working file to the post

Re: Can't read a .jp2 file

Posted: Sun Nov 21, 2010 2:08 pm
by Origami
I'm having the exact same problem write is fine but reading hangs in the IDE and crashes the an .exe. What working version did you find I've tried 1.96 RC1, 1.97 and 1.96 I believe. The RC1 is from my XnView viewer plugins. XnView can open jp2 with no problems. I don't see an attachment to your post but my first time maybe I'm missing it or maybe the mods deleted it? I'd really like to get something that works or know if it is a bug that will be fixed.

Also, can anyone tell me what format the lwf_jp2.dll plugin is for since there are jp2 and lwf plugins also? Thanks

Re: Can't read a .jp2 file

Posted: Thu Nov 25, 2010 8:47 am
by MihGer
Here attached zip'ed dll

Re: Can't read a .jp2 file

Posted: Sun Dec 26, 2010 3:45 pm
by Origami
Thank you. Sorry I hadn't checked back sooner. Unfortunately, I'm still getting an read error "Unknown Format." I noticed that when I try setting the saveformat to AX_jp2000 (or whatever the constant is) checking that property in the debugger shows an application error from the dll but I get no error at runtime. Even when I try setting the format to the number 50, it still seems not to be taking it correctly.

If I save a file with the format set to jp2, the file is apparently saved as a jpg. I can't really tell, but even telling it to save "file.jp2" saves it as "file.jpg" At any rate jpeg2000 seems messed up somehow. I'm using VB6 Enterprise SP6. Thanks for the dll though.