Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect starting frame in sequence bug #42

Closed
Archivist-zz opened this issue Jun 9, 2011 · 13 comments
Closed

Incorrect starting frame in sequence bug #42

Archivist-zz opened this issue Jun 9, 2011 · 13 comments
Assignees
Milestone

Comments

@Archivist-zz
Copy link

I'm using an Array defined with "images:" - I have JPGs named 01 through 41. Incomplete loop ("loops: false"), frames defined as 41 "frames: 41" and frame for starting defined as frame 21 ("frame: 21").

My img that the reel uses is "21" so "21" loads on the page first, and then the reel starts loading.

However, when the reel is finished loading, it sets itself to starting image 20, the wrong one.

If I try to "solve" the problem by cheating and specify "frame: 22" in order to get the offset of -1 and the correct start frame 21, the cheat will work, however, there will be a brief flicker of the wrong image, which is not good.

I hope you can fix this! I really need this before I can add this feature to my website.

@pisi
Copy link
Owner

pisi commented Jun 11, 2011

Dear Archivist,

thank you for reporting the issue. Can you please provide a test case I can look at and play with?

.pisi

@Archivist-zz
Copy link
Author

Yes.

http://www.game-archivist.com/rapture/_virtual.php

Both have 41 frames and both are supposed to start on frame 21, where the object is viewed completely "straight on" from the front of the object.

The first example, click on it and watch carefully while waiting for the frames to load. This one I "cheated" and I told it start frame is 22. If you watch carefully, you'll see it flicker after it has finished loading everything, and it will then load to the correct frame 21 even though I told it 22..

The second example, click on it and watch while it loads. The initial display image is 21 while it is loading. And I told it frame 21. But watch, and after it loads, the image will change, and it will change to start on image 20.

I hope that my explanation makes sense, and that the examples can help you find the issue.

@pisi
Copy link
Owner

pisi commented Jun 24, 2011

Thanks for the example. It really helped me in understanding the effects of this issue. However I wasn't yet successful in nailing down the exact cause of it... I will let you know when I do. Meantime please bear with me as I struggle to dedicate some time to it.

@ghost ghost assigned pisi Jul 9, 2011
@sn3p
Copy link

sn3p commented Jul 26, 2011

I'm having the same problems.

pisi added a commit that referenced this issue Sep 28, 2011
…ly equal to the actual `frame` on which Reel did start. It tries frames 1 to 35 one by one. Test passes, so I will need further information about the conflicting setups.
@pisi
Copy link
Owner

pisi commented Sep 28, 2011

I still don't know how to tackle this one, actually. I've put together a QUnit test to assert the symptoms of this issue - 35 frames sequence tested for 35 different frame values. And it passes for all of them! Please look at the test (it is the last one in issues.js). Do you have some idea how would you extend the test to showoff the issue? Pull requests are welcome ;)

@pisi
Copy link
Owner

pisi commented Sep 30, 2011

Archivist, sn3p,

in the meantime I got to tackle another issue GH-46. The changes made there increased the accuracy and also dealt with rounding issue of the starting frame. And it made me believe (at least for now ;) that this may have an influence also on this issue.

As I'm still unable to reproduce or/and test the symptoms of this issue, the only way to assert that would be to ask you to grab the actual code from the development branch and check the behavior in your applications.

Thank you guys for your time!

@pisi
Copy link
Owner

pisi commented Oct 21, 2011

Closing this issue as resolved as I had the functionality confirmed from another source. Still would appreciate your review of this fix.

@pisi pisi closed this as completed Oct 21, 2011
@tomgrohl
Copy link

I still get this issue with the latest, it it worth re-opening this?

I managed to narrow it down to an event getting triggered twice on page load.

I believe its the frameChange event.

Let me know what you think.

Thanks.

@pisi
Copy link
Owner

pisi commented Nov 24, 2011

@tomgrohl The patched code is still unreleased, so you won't find it in the latest master. Currently it's still in the development branch.

@tomgrohl
Copy link

@pisi

Ah sorry didn't realise.

Thanks for letting me know.

@IsraelThompson
Copy link

This issue is not solved. It's happening to me as well. And 2 years later, no less. Why mark it as closed when those here still reported the issue occurring?

I have a live example of the issue at the link below:

http://dig-houston.com/dev/portfolio/trucks

If you view the source, you can clearly see in the original <img tags, I'm embedding pertinent reel information into "data-" attributes. I.e. data-speed="" data-cw="0" data-frame="23" data-frames="45" data-id="10" data-active="0". As shown, frame 23 is the intended initial frame. But when you look at the later created (by the reel) enclosing DIV, it reports "frame-45" as the opening frame.

The code initiating the reels looks like so:

$reel.each(function(index){
    var $thisReel = $(this)
    var $reelFile = $thisReel.attr('src')
    var $reelFrames = parseInt($thisReel.attr('data-frames'))
    var $reelStartFrame = parseInt($thisReel.attr('data-frame'))
    var $reelCW = $thisReel.attr('data-cw') > 0 ? true : false
    var $reelSpeed = $thisReel.attr('data-speed')
    if ( $(this).closest('.colorReel').size() > 0 ) {
        $thisReel.reel({ loops:true, frames:$reelFrames, frame:$reelStartFrame, footage:4, revolution:600, suffix: '-reel', preloader: 3 })
    } else {
        $thisReel.reel({ frames:$reelFrames, footage:4, speed:parseFloat($reelSpeed), cw:$reelCW })
    }
})

Since the data is being tossed around from multiple sources and dynamic vars are being injected into the mix, I've toyed around with parseInt() to make sure the numbers are not string, and noticed a slight variation in results. But the problem still remains that it never initiates on the exact frame I want. I've even tried manually typing in my desired frame instead of passing vars, and it's a no go. I get varying results. If I type 23, I get 45. If I turn off parseInt() I get 5 instead of 45. However, if I type 24, 25, or 10, it actually obeys and gives me the proper frame. In fact, as I'm testing right now, I'm noticing that 23 seems to be the only frame it will not obey.

So, let's pick this apart. With 45 frames, 23 happens to be the frame exactly in the middle (with 22 frames on either side of it). Coincidence? Also, possibly worth mentioning, is that 45 is not perfectly divisible by 2, in being 22.5 is the answer. Math problems?

At any rate, I think I'm onto something, but I'm not sure where the next level of testing should go.

@pisi
Copy link
Owner

pisi commented Jul 9, 2013

Izzy, first please be aware, that using -devel code as you do is always at your own risk. If it was 100% stable, it would be released already and not sit in development branch. Only versions without this amendment are race-worthy.

However, you are right, something's not right there, but since it happens in sprite too, it doesn't quite belong here in this particular sequence-related issue (it is somewhat related tho..) So let's move this to a dedicated place - issue #213

@IsraelThompson
Copy link

Ok, good call... Let me know if there's another way you'd like me to test
this.

Izz

On Tue, Jul 9, 2013 at 11:38 AM, Petr Vostřel notifications@github.comwrote:

Izzy, first please be aware, that using -devel code as you do is always
at your own risk. If it was 100% stable, it would be released already and
not sit in development branch. Only versions without this amendment are
race-worthy.

However, you are right, something's not right there, but since it happens
in sprite too, it doesn't quite belong here in this particular
sequence-related issue (it is somewhat related tho..) So let's move this to
a dedicated place - issue #213 #213


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-20687493
.

pisi added a commit that referenced this issue Aug 25, 2013
pisi added a commit that referenced this issue Aug 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants