Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18564] ImageView - Image Array; fails consistently on Android

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-03-09T22:06:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid
LabelsTCSupportTriage
ReporterMalcolm Hollingsworth
AssigneeHieu Pham
Created2015-01-15T16:48:08.000+0000
Updated2017-03-16T22:24:41.000+0000

Description

When setting the Images array property and allowing the ImageView to display for more than 4 minutes. * Changing the number of images within the array does not affect the failure * Changing the location of the source files does not affect the failure * Changing the duration does not affect the failure * Changing the size of the Image width and height does not affect the failure * Having one or more ImageViews each with the same or different numbers of array images does not affect the failure * Setting a repeatCount does not affect the failure (if the count exceeds the failure point) * Not having a repeatCount does not affect the failure * File format of Image does not affect the failure It appears to be related to a combination of iterations, duration and size - but each attempt to work out the issue results in failure in around 5 minutes or less. {panel:title=Error message|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE}OpenGLRenderer: Cannot generate texture from bitmap{panel} Simplified example code;
<ImageView
    id="img"
    backgroundColor="purple",
    duration="200",
    height="50",
    repeatCount="2000",
    width="50"
/>
$.img.setImages([
    "/images/red/red1.png",
    "/images/red/red2.png",
    "/images/red/red3.png",
    "/images/red/red4.png"
]);
Simply leaving the animation to continue crashes the image, empties the ImageView to black and shows the error message above in the console each additional iteration.

Comments

  1. Shuo Liang 2015-01-16

    Hi, Just test your case, but can't reproduce your problem with my Device: Samsung Galaxy Nexus. I left the animation for more than 10 mins, nothing went wrong. So would you please try 1. Use the latest SDK 3.5.0.GA 2. If it still happens, provide the more detail in studio console when app crash. 3. You may want to try a classic project for this problem. Here is the test case.
       var win = Ti.UI.createWindow({
       	backgroundColor:'White'
       });
       
       var imageView = Ti.UI.createImageView({
       	id:"img",
           backgroundColor:"purple",
           duration:"2000",
           height:"50",
           repeatCount:"2000",
           width:"50",
           images:[
           	"/images/Test/1.png",
           	"/images/Test/2.png",
           	"/images/Test/3.png",
           	"/images/Test/4.png"
           ]
       });
       
       imageView.start();
       
       win.add(imageView);
       win.open();
       
  2. Ingo Muschenetz 2015-01-27

    [~core13] did you see the comment?
  3. Malcolm Hollingsworth 2015-02-03

    [~ingo] I did not - will thoroughly test again today, although previous tests were performed on 3.5, may have been beta version though.
  4. Malcolm Hollingsworth 2015-02-03

    I have tested again using Ti SDK 3.5 GA, having reviewed my notes I had already done this last time. So to confirm; using Ti SDK 3.5 GA on Android using Android 4.4.4 (although others result in the same results) - it fails. I have performed the tests using the image width and height (widget.tss) of 50x50 and 400x400. The timer out put shows 67 iterations which is around 5.5 minutes - using 250x250. The image array is now shown only as a black box and displaying the same error message mentioned initially. Having stopped the app from running within Studio I noticed that after a period of time (between 2-8 minutes - was not paying attention) the black square does then actually start back up showing the image array displaying. I had not actually stopped the app running in the Genymotion simulator, however after around another 5 minutes the same square went black again. I then changed the image displayed size to 50x50, the original images used are still 400x400. 73 iterations this time so around 6 minutes. Having closed the app from running with Studio but let the actual app running on the device - it again stopped displaying the black broken image and returned to the image array stepping. After a while this again broke and the process keeps working, then failing, then working then failing. I have duplicated the test just performed (50x50) and managed 67 iterations which is around 5.5 minutes - still boke in the same way with the same results - so on and so forth. This is easy to reproduce. The problem is repeatable on more than one development machine and in each of the Ti SDK versions previously mentioned - so tested Ti SDK 3.3 GA to 3.5 GA. Between each test the project build folder is cleaned and the app is removed from the device active apps. You can create the images I am using yourself by saving the results of these links [http://placehold.it/400x400/00c600/ffffff&text=A] is greena.jpg http://placehold.it/400x400/00c600/ffffff&text=B is greenb.jpg http://placehold.it/400x400/00c600/ffffff&text=C is greenc.jpg http://placehold.it/400x400/00c600/ffffff&text=D is greend.jpg http://placehold.it/400x400/c60000/ffffff&text=1 is red1.jpg http://placehold.it/400x400/c60000/ffffff&text=2 is red2.jpg http://placehold.it/400x400/c60000/ffffff&text=3 is red3.jpg http://placehold.it/400x400/c60000/ffffff&text=4 is red4.jpg http://placehold.it/400x400/c60000/ffffff&text=5 is red5.jpg
       var times = 0;
       var ext = '.jpg';
       
       var imgRed = Alloy.createWidget('ImageArray', 'widget', {
           //duration: 2500 * .25 * .25,
           duration: 200,
           images: [
               '/images/green/greena' + ext,
               '/images/green/greenb' + ext,
               '/images/green/greenc' + ext,
               '/images/green/greend' + ext,
               '/images/red/red1' + ext,
               '/images/red/red2' + ext,
               '/images/red/red3' + ext,
               '/images/red/red4' + ext,
               '/images/red/red5' + ext
           ],
           left: 100,
           top: 30
       });
       $.win.add(imgRed.getView());
       imgRed.getView().start();
       
       <Alloy>
       	<ImageView id="img" />
       </Alloy>
       
       var args = arguments[0] || [];
       
       var handler = function (e) {
           var currentdate = new Date(); 
           var datetime =  + currentdate.getHours() + ":"  
               + currentdate.getMinutes() + ":" 
               + currentdate.getSeconds();
       
           Ti.API.info(e.type + ': ' + datetime);
       };
       $.img.addEventListener('start', handler);
       $.img.addEventListener('stop', handler);
       
       if (args.images && args.images.length > 0) {
           Ti.API.info('has images');
       	$.img.setDuration(args.duration || 1000);
       	$.img.setImages(args.images || []);
       	$.img.setLeft(args.left || 10);
       	$.img.setTop(args.top || 30);
       }
       
       "#img": {
           backgroundColor: 'purple',
           height: 250,
           repeatCount: 0,
           width: 250
       }
       
    There is a real problem here - I am not imaging it.
  5. Hieu Pham 2015-03-04

    master PR: https://github.com/appcelerator/titanium_mobile/pull/6689
  6. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source