while (elapsed > seconds_per_frame) {
elapsed -= seconds_per_frame;
- if (++newframe >= info.nframes) {
+ if (++newframe >= image->frames) {
if (!info.looping) {
gtk_toggle_button_set_active(play, FALSE);
break;
static int alloc_framebuffer(struct lbx_image *image)
{
- struct lbx_imginfo info;
GtkSpinButton *spin;
if (framebuf)
g_object_unref(framebuf);
- lbx_img_getinfo(image, &info);
framebuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
- info.width, info.height);
+ image->width, image->height);
g_return_val_if_fail(framebuf, -1);
spin = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "framespin"));
- gtk_spin_button_set_range(spin, 0, info.nframes-1);
+ gtk_spin_button_set_range(spin, 0, image->frames-1);
gtk_spin_button_set_value(spin, 0);
- gtk_widget_set_size_request(canvas, info.width, info.height);
+ gtk_widget_set_size_request(canvas, image->width, image->height);
return 0;
}