Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005692 [Squeak] Morphic minor always 01-02-07 02:52 09-09-08 15:34
Reporter haleden View Status public  
Assigned To
Priority normal Resolution fixed  
Status closed   Product Version 3.9
Summary 0005692: AnimatedImageMorph
Description final-7067

some animated gifs draw strangely (artifacts from previous steps remain on display).

using the previous image to draw in erase mode in the step method seems to help.

step
    | f d |
    images isEmpty
        ifTrue: [^ self].
    nextTime > Time millisecondClockValue
        ifTrue: [^self].
    f _ images at: imageIndex.
    f displayOn: self image at: 0@0 rule: Form erase.
    imageIndex _ imageIndex \\ images size + 1.
    f _ images at: imageIndex.
    f displayOn: self image at: 0@0 rule: Form paint.
    self invalidRect: (self position + f offset extent: f extent) .
    d _ (delays at: imageIndex) ifNil: [0].
    nextTime := Time millisecondClockValue + d
Additional Information
here is a gif that shows the behavior described and works with the described change
Attached Files  Dragon-18-june.gif [^] (32,099 bytes) 01-02-07 02:52
 AnimatedImageMorph-step.st [^] (481 bytes) 01-02-07 04:37

- Relationships

- Notes
(0008784 - 550 - 1095 - 1095 - 1095 - 1095 - 1095)
haleden
01-02-07 02:58

guess needed to check bondary condition

step
    | f d |
    images isEmpty
        ifTrue: [^ self].
    nextTime > Time millisecondClockValue
        ifTrue: [^self].
    imageIndex > 0 ifTrue: [
        f _ images at: imageIndex.
        f displayOn: self image at: 0@0 rule: Form erase.
    ].
    imageIndex _ imageIndex \\ images size + 1.
    f _ images at: imageIndex.
    f displayOn: self image at: 0@0 rule: Form paint.
    self invalidRect: (self position + f offset extent: f extent) .
    d _ (delays at: imageIndex) ifNil: [0].
    nextTime := Time millisecondClockValue + d
 
(0008785 - 1088 - 1272 - 1272 - 1272 - 1272 - 1272)
wiz
01-02-07 04:35
edited on: 01-02-07 09:18

Hmmm.

This sounds like a need to do a self changed before and after
the image change so the invalid rectangle is set to include both the before and after bounds. The usual error is to just do on self changed after the update. If the before bounds is not encompassed by the after the left over pixels can persist.

so looking at your code
a simple
self changed.
self image: images at: imageIndex.
self changed.

should work .

And it does... Try uploaded #step fix.


Yours in service, -- Jerome Peace

P.S. nice dragon.

P.P.S.
I do not know if this fix solves all possible problems. Can you think of some good sUnit tests to give animated gifs a work out? That would be helpful.

P.P.P.S. problem was being caused by the drawing on Translucent pixels.
My fix worked because we eliminated that by shifting the drawing to the imageMorph draw on function where it probably belongs anyway.

I found this out when I set your dragon to be the background pattern.
Whenever the annimation drew over the "transparent" portion of the background the pixels stuck.

 
(0008786 - 500 - 536 - 536 - 536 - 536 - 536)
haleden
01-02-07 06:01

ahh, yes, that is much better.

the gif is one i downloaded to play with in squeak (from bestanimations.com) while showing squeak to my son, and i just thought that something was wrong, so i tried something to make it work--your solution is much better.

i don't know enough about the animated gifs to be able come up with a general case--i was just acting as a user in this case. an sunit might be tricky--could there be a comparison of the current image with the current animation step?

hal
 
(0010944 - 85 - 85 - 85 - 85 - 85 - 85)
wiz
07-28-07 22:43

I don't know when this got included but the patch is in 7130 so this can be resolved.
 
(0010948 - 178 - 208 - 208 - 208 - 208 - 208)
ScottWallace
07-29-07 06:40

Jerome, the first "self changed" in your fix is superfluous, since in the very next line, "self image: ..." is sent, and the first thing that #image: does is send "self changed".
 
(0011460 - 86 - 86 - 204 - 204 - 204 - 204)
matthewf
11-24-07 17:06

Reminder sent to: edgardec

Has this issue been fixed? It is listed on http://wiki.squeak.org/squeak/5961 [^] as ready
 
(0011463 - 88 - 94 - 94 - 94 - 94 - 94)
edgardec
11-24-07 19:53

Was fixed , loooong time ago.
And I send a cute running cheetah to Jerome for test this
 
(0012607 - 128 - 128 - 128 - 128 - 128 - 128)
KenCausey
09-09-08 15:33

Harvested in update 7088 and released in 3.10. I believe Scott's point is valid but a new issue should be opened to address it.
 

- Issue History
Date Modified Username Field Change
01-02-07 02:52 haleden New Issue
01-02-07 02:52 haleden File Added: Dragon-18-june.gif
01-02-07 02:58 haleden Note Added: 0008784
01-02-07 03:37 haleden Issue Monitored: haleden
01-02-07 04:35 wiz Note Added: 0008785
01-02-07 04:37 wiz File Added: AnimatedImageMorph-step.st
01-02-07 04:43 wiz Note Edited: 0008785
01-02-07 05:05 wiz Note Edited: 0008785
01-02-07 06:01 haleden Note Added: 0008786
01-02-07 09:18 wiz Note Edited: 0008785
07-28-07 22:43 wiz Note Added: 0010944
07-28-07 22:43 wiz Status new => resolved
07-28-07 22:43 wiz Resolution open => fixed
07-28-07 22:43 wiz Fixed in Version  => 3.10
07-29-07 06:40 ScottWallace Note Added: 0010948
11-24-07 17:06 matthewf Issue Monitored: edgardec
11-24-07 17:06 matthewf Note Added: 0011460
11-24-07 19:53 edgardec Note Added: 0011463
09-09-08 15:33 KenCausey Status resolved => closed
09-09-08 15:33 KenCausey Note Added: 0012607


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
85 total queries executed.
48 unique queries executed.
Powered by Mantis Bugtracker