Simulator crashes when applying src to img-element inproperly

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    10 posts
    Member since:
    Nov 2008

    Posted 30 Sep 2013 Link to this post

    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.
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 01 Oct 2013 Link to this post

    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.
  3. Daniel
    Daniel avatar
    10 posts
    Member since:
    Nov 2008

    Posted 02 Oct 2013 Link to this post

    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
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 07 Oct 2013 Link to this post

    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.
Back to Top