APOLLO & ECW/JP2 Discussions

Wondering how others have configured their ERDAS APOLLO server or what data they are crawling? The ERDAS APOLLO Discussion board is a place to find information, share ideas and more. Join the community, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 5
Registered: ‎08-17-2016

Unable to load .j2k files using provided examples

[ Edited ]

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

Highlighted
Staff inactive
Posts: 57
Registered: ‎10-12-2015

Re: Unable to load .j2k files using provided examples

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??

Occasional Contributor
Posts: 5
Registered: ‎08-17-2016

Re: Unable to load .j2k files using provided examples

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.

Technical Evangelist
Posts: 860
Registered: ‎07-30-2015

Re: Unable to load .j2k files using provided examples

Do you mean you get this error? 

ecw.jpg

 

best

haiyan

Occasional Contributor
Posts: 5
Registered: ‎08-17-2016

Re: Unable to load .j2k files using provided examples

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

Technical Evangelist
Posts: 860
Registered: ‎07-30-2015

Re: Unable to load .j2k files using provided examples

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

Technical Evangelist
Posts: 860
Registered: ‎07-30-2015

Re: Unable to load .j2k files using provided examples

Here is the CR defect

CR 1-QR3Z2P Unable to load .j2k files using provided decompress example 4 (SDK 5.3.0 Windows) 

Occasional Contributor
Posts: 5
Registered: ‎08-17-2016

Re: Unable to load .j2k files using provided examples

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?

Technical Evangelist
Posts: 860
Registered: ‎07-30-2015

Re: Unable to load .j2k files using provided examples

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

Occasional Contributor
Posts: 5
Registered: ‎08-17-2016

Re: Unable to load .j2k files using provided examples

Read only, for the time being.