Can't read a .jp2 file

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

MihGer
Posts: 6
Joined: Mon Oct 18, 2010 3:16 pm

Can't read a .jp2 file

Post 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.
MihGer
Posts: 6
Joined: Mon Oct 18, 2010 3:16 pm

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

Post 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
Origami
Posts: 3
Joined: Sun Nov 21, 2010 12:24 pm

Re: Can't read a .jp2 file

Post 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
MihGer
Posts: 6
Joined: Mon Oct 18, 2010 3:16 pm

Re: Can't read a .jp2 file

Post by MihGer »

Here attached zip'ed dll
You do not have the required permissions to view the files attached to this post.
Origami
Posts: 3
Joined: Sun Nov 21, 2010 12:24 pm

Re: Can't read a .jp2 file

Post 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.