<div dir="ltr"><div>See my reply to Nicolas. <br></div><div>The algorithm could be refined a bit to cover other cases.</div><div><br></div><div>Best,</div><div>Karl</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 14, 2020 at 12:24 AM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu">leves@caesar.elte.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Karl,<br>
<br>
A potential speedup is to use #anySatisfy: instead of #do: to stop when <br>
the first image that satisfies the condition is detected.<br>
<br>
<br>
Levente<br>
<br>
On Sat, 13 Jun 2020, karl ramberg wrote:<br>
<br>
> I was afraid this would be a slow search, but its negligible.<br>
> Tested performance on a quite big gif* and it was only 1900 ms on my slow computer<br>
> <br>
> *<a href="https://web.archive.org/web/20140209162456/http://www.majhost.com/gallery/NoBullet/TF2/t2.gif" rel="noreferrer" target="_blank">https://web.archive.org/web/20140209162456/http://www.majhost.com/gallery/NoBullet/TF2/t2.gif</a><br>
> <br>
> Best,<br>
> Karl<br>
> <br>
> On Sat, Jun 13, 2020 at 1:12 PM <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br>
>       Karl Ramberg uploaded a new version of MorphicExtras to project The Trunk:<br>
>       <a href="http://source.squeak.org/trunk/MorphicExtras-kfr.275.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/MorphicExtras-kfr.275.mcz</a><br>
><br>
>       ==================== Summary ====================<br>
><br>
>       Name: MorphicExtras-kfr.275<br>
>       Author: kfr<br>
>       Time: 10 June 2020, 6:41:33.727777 pm<br>
>       UUID: 26fa97c9-e242-8048-8c7c-53b2061c19f4<br>
>       Ancestors: MorphicExtras-mt.274<br>
><br>
>       Detect if animated image (eg. gif) has transparent color and use opaque background if so.<br>
><br>
>       =============== Diff against MorphicExtras-mt.274 ===============<br>
><br>
>       Item was changed:<br>
>         ----- Method: AnimatedImageMorph>>fromReader: (in category 'private') -----<br>
>         fromReader: reader<br>
>       -<br>
>               images := reader forms.<br>
>               delays := reader delays.<br>
>       +       images do:[: each | (each colors includes: Color transparent) ifTrue:[self isOpaque: true]].<br>
>       -       self isOpaque: true.<br>
>               self reset.!<br>
> <br>
> <br>
> <br>
><br>
</blockquote></div>