Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Contributor
Posts: 3
Registered: ‎04-03-2012
My Device: Bold 9700
My Carrier: Bell

img_load_file need help

I am trying to load an image, using the example from the gesture tutorial and I am running into a problem.

 

I do this:

 

 rc = img_load_file(ilib, path, &callouts, &img);

 

and rc is equal to 9 and I am not sure what that means since the documentation uses "IMG_ERR_OK" and "IMG_ERR_CORRUPT"

 

Here is a link to the documentation I am talking about above: https://developer.blackberry.com/native/reference/com.qnx.doc.libimg.lib_ref/com.qnx.doc.neutrino.li... 

 

I am guessing the error is IMG_ERR_TRUNC, but I am not sure how that can be, since I am copying the image from the Gesture example, and that works fine.

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: img_load_file need help

From target/qnx6/usr/include/img/img_errno.h:

 

#define IMG_ERR_OK            0
#define IMG_ERR_TRUNC        1    /* premature EOF */
#define IMG_ERR_CORRUPT        2    /* unrecoverable error in data stream */
#define IMG_ERR_FORMAT        3    /* file format not recognized */
#define IMG_ERR_NODATA        4    /* no data present */
#define IMG_ERR_NOSUPPORT    5    /* request value/format/conversion not supported */
#define IMG_ERR_MEM            6    /* memory allocation error */
#define IMG_ERR_CFG            7    /* bad or missing config file */
#define IMG_ERR_DLL            8    /* error accessing dll or entrypoint */
#define IMG_ERR_FILE        9    /* file access error */
#define IMG_ERR_INTR        10    /* operation interrupted by application */
#define IMG_ERR_PARM        11    /* invalid parameter */
#define IMG_ERR_NOTIMPL        12    /* operation not implemented */

 

So you are getting a file access error.  I suggest just opening the file and checking errno for more details.

 

Stuart