4
$\begingroup$

I am seeing something strange, and I am not sure if it's something I am doing poorly in Wolfram Language or an issue with the system.

This probably best described with a minimal working example. First, I will define a function to make it easy to create a set of images.

images[n_, size_] := 
  images[n, size] = 
     Table[Show@RandomImage[1, {size, size}, ColorSpace -> "RGB"], {n}]

Now I make a DynamicModule to hold my animation which is driven by the Trigger control. In this case the there will be 100 100x100 images.

DynamicModule[{i}, Deploy@Column[
  {Dynamic[images[100,100][[i]]],
   Trigger[Dynamic[i], {1, 100, 1}, AnimationRepetitions -> Infinity],
   Dynamic[{i}]
   }
  ], Initialization :> {i = 1}
 ]

Now the above seems to run with no issues on my machine (11.2, Windows 7). BUT, if the image size increase to say 600

DynamicModule[{i}, Deploy@Column[
   {Dynamic[images[100, 600][[i]]],
    Trigger[Dynamic[i], {1, 100, 1}, AnimationRepetitions -> Infinity],
    Dynamic[{i}]
   }
   ], Initialization :> {i = 1}
 ]

Then my animation halts almost immediately (when I just ran it now it stopped at i=16.

Can anyone else reproduce this behavior?

$\endgroup$
2
  • $\begingroup$ memory? I am using macOS 10.13 and MMA 11.2 and I do not have any problem..., up to a size of 1000 :(( $\endgroup$ Nov 9, 2017 at 17:48
  • 1
    $\begingroup$ I'd report that $\endgroup$
    – Kuba
    Nov 9, 2017 at 20:31

1 Answer 1

3
$\begingroup$

In case you are interested in a workaround:

DynamicModule[{i, task},
 Column[{
   Dynamic[images[100, 600][[i]]]
 , Grid[{{
     Button["\[FilledRightTriangle]", task = RunScheduledTask[i = Mod[++i, 100, 1], .1]]
   , Button["\[FilledSquare]", RemoveScheduledTask@task]
   }}]
 , Dynamic[{i}]
 }]
, Initialization :> {i = 1}]
$\endgroup$
3
  • $\begingroup$ Very nice. You'll likely get the check, but I'll keep this open for other answers. $\endgroup$
    – chuy
    Nov 9, 2017 at 20:50
  • 2
    $\begingroup$ I also found that wrapping my expression in ExpressionCell[...,Deployed-> True] seemed to help. $\endgroup$
    – chuy
    Nov 9, 2017 at 20:51
  • $\begingroup$ @chuy good to know, you never know what can fix those fishy fe bugs. Anyway, please report this and let us know what they said. $\endgroup$
    – Kuba
    Nov 10, 2017 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.