This is a migrated thread and some comments may be shown as answers.

Simulator crashes when applying src to img-element inproperly

3 Answers 50 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 30 Sep 2013, 12:48 PM
I'm working with Visual Studio 2012 extension, Windows 8, JQuery Mobile.
I have a pagebeforeshow function in which I add a byte-array as src for an img-element. If that byte-array does not start with "data:image/jpeg;base64," the whole simulator crashes instead of showing an error.

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 01 Oct 2013, 07:44 AM
Hi Daniel,

While adding "data:image/jpeg;base64" is a must in such case, we still could not reproduce a crash in our local tests, the image is simply not displayed. We would appreciate if you could prepare a sample that shows the problem at hand, you could use http://jsbin.com/.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Daniel
Top achievements
Rank 1
answered on 02 Oct 2013, 02:22 PM
Hello Steve,

I've created a test project in VS2012 for you to see the issue. In order to reproduce it,
1 - open the .sln and run the project in the simulator,
2 - in the simulator, hit the "Image Example" button.
3 - on the image page, hit the "Camera" button and select any image, which is then displayed in the <img> tag.
4 - click the back button to return to the home page.
5 - click the "Image Example" button again. At this point the simulator crashes.

A model.js and an image.js have been added to the project. The former defines a prototype to store data in (in this case, the image). The latter defines the Cordova camera functions and binds an event listener to the "pagebeforeshow"-event of the image page, in which the data from the variable is set as src of the <img> tag.
I have commented the two important lines of code in the image.js file, so you can see when the error occurs.

Since I am not able to upload a .zip as attachment, have a google drive link with the file stored:
https://docs.google.com/file/d/0B0BgKlGC_zViNmc3bzludGNBVUk/edit?usp=sharing

Cheers
0
Steve
Telerik team
answered on 07 Oct 2013, 01:56 PM
Hi Daniel,

Thanks for the sample project and steps to reproduce. The same problem occurs in Mist and Graphite, so it appears the problem is with CEF (Chromium Embedded Framework) which we use in the Simulator. The same crash would be observed in Chrome browser, should you remove the Cordova part and try to run this code in regular web app.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
Report a bug
Asked by
Daniel
Top achievements
Rank 1
Answers by
Steve
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or