[squeak-dev] [Discussion] GIF and Animated GIF Refactoring

Eric Gade eric.gade at gmail.com
Sat Dec 4 19:46:32 UTC 2021


Whoops, sorry all! The changeset was incorrect. Please use the revised
changeset attached to this message. The content of the previous message
still applies.

On Sat, Dec 4, 2021 at 1:18 PM Eric Gade <eric.gade at gmail.com> wrote:

> Hi Marcel (and others)
>
> On Mon, Nov 29, 2021 at 5:45 AM Marcel Taeumel <marcel.taeumel at hpi.de>
> wrote:
>
>>
>> Well, for the sake of backwards compatibility, maybe you could do instead:
>>
>> 1*) Improve GIFReadWriter while ensuring that the obviously public
>> protocol stays functional. Empty out AnimatedGIFReadWriter but leave it
>> there.
>> 2*) Improve AnimatedImageMorph while ensuring that the obviously public
>> protocol stays functional. No new class BetterAnimatedImageMorph.
>>
>> Regarding the process:
>> - If single package: Inbox
>> - If multiple packages: Change set via squeak-dev
>>
>
> After some wrangling between Squot and Changesets (yikes!), I was able to
> come up with the following changeset (attached).
>
> Here is what I did:
> 1) Updated AnimatedImageMorph to have the new/updated functionality from
> BetterAnimatedImageMorph, while maintaining the same methods and
> deprecating as needed;
> 2) Added the classes needed for new GIF parsing
> 3) Updated GIFReadWriter to use the new parsing methods
> 4) Deprecated the AnimatedGIFReadWriter class using the technique of
> adding #deprecated: to #basicNew
> 5) I have added a GIFReadWriterTest class that tests both the regular and
> animated GIF reading/writing at the same time. There are issues (see below).
>
> If you would like to quickly test that things are working, do the
> following in a workspace:
> ```
> GIFReadWriter exampleAnim.
> (AnimatedImageMorph new fromGIFFileNamed: 'anim.gif') openInHand.
> ```
>
> You should see an animated, growing red circle on a while background. See
> the class method comment.
>
> Note on tests: I copied the GIFReadWriterTest class over from my Pharo
> implementation with minimal (file api related) modification. The tests are
> not passing and the reason is a bit confusing. Here's what's up: in these
> tests I write out a Form that has different colors in each quadrant, read
> it back in, and make sure the color values are the same. But apparently in
> Squeak when you use `FormCanvas fillColor: Color black`, the color that is
> put into the Form is not, in fact, equivalent to Color black. It is instead
> something like rgb(0,0,0.04). Is this intentional? If so, do you recommend
> that I simply update the tests to match on this specific color?
>
> This is my first submission via changeset so definitely let me know if I
> messed up. Thanks!
> --
> Eric
>


-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211204/e4ab2f1f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Animated-GIF-Update.2.cs
Type: text/x-csharp
Size: 58396 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211204/e4ab2f1f/attachment.bin>


More information about the Squeak-dev mailing list