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

Reply
Developer
SuhairZain
Posts: 121
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA
Accepted Solution

Unable to load image

Hi, i tried to set an image to an imageview, but got this error. The interesting thing is that  there are Images that I added earlier to the project. They work just fine, the problem is with new images.

 

helpRootImage->setImage("asset:///images/help/connecTapp.png");

 and i got this error in the log

 

libpng warning: iCCP: known incorrect sRGB profile
"Unable to get asset in (/apps/com.example.ConnecTappTest.testDev_necTappTest93cfa27a/native/assets/): (/images/help/connecTapp.png)." 
Image not found:  "/images/help/connecTapp.png"

 the images are there in the assets folder. And using target file system navigator, i also confirmed that images are there in the device's asset folder too. They are there, they simply won't load. Any suggestions?

Please use plain text.
Developer
Benecore
Posts: 396
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: Unable to load image

[ Edited ]

You need to use Image

Q_SLOT void setImage (const Image &image)

or change function and use QUrl

Q_SLOT void setImageSource (const QUrl &source)

 

so try

 

helpRootImage->setImage(Image("asset:///images/help/connecTapp.png"));
or
helpRootImage->setImageSource(QUrl("asset:///images/help/connecTapp.png"))


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
BBSJdev
Posts: 5,986
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Unable to load image

[ Edited ]

[edit] didnt read the last sentence.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
SuhairZain
Posts: 121
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Unable to load image

But I simply use objName.setImage("image url"); and it works.. y only this??
Please use plain text.
Developer
SuhairZain
Posts: 121
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Unable to load image

Well, I had to solve it out myself. The solution was rather simple. There was an .assets.index file in the assets folder. I deleted and the next time I built, everything was perfect. :smileyhappy:

Please use plain text.
Developer
BBSJdev
Posts: 5,986
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Unable to load image

Glad you solved it, it's hard to diagnose a corrupted or unupdated file.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 5,986
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Unable to load image

Actuallt it's the first thing I do if something isn't being found or linked properly is do a clean build. Good practice.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
Benecore
Posts: 396
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: Unable to load image

Exactly @BBSJdev, if i've got a problem then first clean/build project again. This i do always when is a problem



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
SuhairZain
Posts: 121
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Unable to load image

Well, I tried it. But didn't help.. today itself I had a case where I was unable to set padding to a container. Couldn't do it no matter how hard I tried. I closed the ide and opened it again, and everything was just fine. Don't know what happens to these things at times.. :smileyhappy:
Please use plain text.
Developer
BBSJdev
Posts: 5,986
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Unable to load image

Since the latest update I've not been able to load a qml file after restarting momentics, a hack is to rename the project back and forth.
However I least I know this has been recognised within BlackBerry and should be fixed in the next update.

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.