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

Traceback (most recent call last): #11

Open
dimaromanenko opened this issue Oct 18, 2013 · 4 comments
Open

Traceback (most recent call last): #11

dimaromanenko opened this issue Oct 18, 2013 · 4 comments

Comments

@dimaromanenko
Copy link

Hi, script RuntimeError when 100 images need packing.
List error:
python anim_encoder.py ani2
ani2 packing, num rects: 2909 num frames: 50
Traceback (most recent call last):
File "anim_encoder.py", line 234, in
generate_animation(sys.argv[1])
File "anim_encoder.py", line 189, in generate_animation
dy, dx = allocator.allocate(w, h)
File "anim_encoder.py", line 111, in allocate
raise RuntimeError()
RuntimeError

@perpetual-hydrofoil
Copy link

RuntimeError is being raised when it falls out with a lot of images.

def allocate(self, w, h):
    bh, bw = shape(self.bitmap)

    for row in xrange(bh - h + 1):
        if self.available_space[row] < w:
            continue

        for col in xrange(bw - w + 1):
            if self.bitmap[row, col] == 0:
                if not self.bitmap[row:row+h,col:col+w].any():
                    self.bitmap[row:row+h,col:col+w] = 1
                    self.available_space[row:row+h] -= w
                    self.num_used_rows = max(self.num_used_rows, row + h)
                    return row, col

    raise RuntimeError()

@johnallred
Copy link

I'm seeing this same error with 45 images on RHEL 7.

@wbond
Copy link
Member

wbond commented Jul 20, 2017

There is a constant set in anim_encoder.py that limits the resulting png to 10,000 lines. It seems your animation has so much content as to not be able to fit within 10,000 vertical lines.

You could try increasing the limit, however the resulting PNG will likely have a rather large filesize if you have that much image data.

@perpetual-hydrofoil
Copy link

perpetual-hydrofoil commented Aug 11, 2017

@wbond That makes sense; perhaps a parameter or more info in the error message would make sense. The X11-Canvas-Screencast project (rprichard/x11-canvas-screencast#2) makes use of this in order to essentially make videos, so those will probably end up with a large file size as you point out.

https://github.com/sublimehq/anim_encoder/blob/master/anim_encoder.py#L44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants