08-17-2016
11:40 AM
- last edited on
09-28-2018
06:27 AM
by
fcaelen
I'm attempting to evaluate the capabilities and speed of the ECW JP2 SDK for one of our projects. Unfortunately, while using the decompressor example 4 (the one demonstrating NCSSetIOCallbacks) I've run into a problem opening anything other than sample data .jp2 files. Specifically, I'm using p0_07.j2k file used in the OpenJPEG conformance tests. The callbacks eventually fail in a seek call that attempts to access an address way past the end of the file. It appears that .j2k files work correctly using the C++ interface but due to our intended use, I'm limited to using the C functions. Any help would be greatly appreciated.
Christiaan
08-18-2016 05:15 AM
So...what version of the ECWSDK are you using? Windows or Linux? Do you have any small code snippets that can be sharred to see if it can be reproduced??
08-18-2016 05:55 AM
I'm using version 5.3.0 of the SDK on Windows 10. The code I used was sample 4 in the decompressor examples of the SDK, built using vc14 as x64 executable. Also, here's a link to the image I was trying to read:
https://github.com/uclouvain/openjpeg-data/blob/master/input/conformance/p0_07.j2k
Thanks.
08-18-2016 09:45 AM
Do you mean you get this error?
best
haiyan
08-18-2016 10:46 AM
Yes, that would be the one. It appears that the problem is caused by the Library calling the provided FileSeekCB function with a file offset of 0xff4fff51 (which happens to be the first 4 "magic" bytes of any j2k file). This in turn forces the FileSeekCB function to return NCS_FILEIO_ERROR (48).
08-18-2016 11:16 AM
I see, the fseek return -1, and FileSeekCB returns NCS_FILEIO_ERROR.
According to SDK development team, this seems to be a known issue. Anyway I will report CR defect for this issue.
static NCSError FileSeekCB(void *pClientData, UINT64 nOffset, UINT32 nOrigin) { MyDataStruct *pData = (MyDataStruct*)pClientData; if(pData && pData->pFile) { int nRet; nRet = fseek(pData->pFile, (long)nOffset, nOrigin); if(nRet == 0) { return(NCS_SUCCESS); } return(NCS_FILEIO_ERROR); } return(NCS_INVALID_PARAMETER); }
Thanks & best regards!
haiyan
08-18-2016 12:10 PM
Here is the CR defect
CR 1-QR3Z2P Unable to load .j2k files using provided decompress example 4 (SDK 5.3.0 Windows)
08-18-2016 12:46 PM
Thanks for submitting the defect. Do you know if there is an ETA on the fix? Also, is there somewhere I can track the status of this CR and be notified of it's resolution?
08-18-2016 12:56 PM
You can create SR (service request), and then you should be able to get notification for the status.
Are you use the free Read-only SDK or Read-write SDK?
best
haiyan
08-18-2016 12:59 PM
Read only, for the time being.