ddjvu_context_t *d_context;
ddjvu_document_t *d_document;
ddjvu_format_t *d_format;
+
+ gchar *uri;
};
typedef struct _DjvuDocumentClass DjvuDocumentClass;
ddjvu_message_wait (djvu_document->d_context);
ddjvu_message_pop (djvu_document->d_context);
}
+ g_free (djvu_document->uri);
+ djvu_document->uri = g_strdup (uri);
return TRUE;
}
const char *uri,
GError **error)
{
- g_warning ("djvu_document_save not implemented"); /* FIXME */
- return TRUE;
+ DjvuDocument *djvu_document = DJVU_DOCUMENT (document);
+
+ return ev_xfer_uri_simple (djvu_document->uri, uri, error);
}
static int
gdk_pixbuf_get_rowstride (pixbuf),
(gchar *)gdk_pixbuf_get_pixels (pixbuf));
- rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, rc->rotation);
+ rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rc->rotation);
g_object_unref (pixbuf);
return rotated_pixbuf;
ddjvu_context_release (djvu_document->d_context);
ddjvu_format_release (djvu_document->d_format);
+ g_free (djvu_document->uri);
G_OBJECT_CLASS (djvu_document_parent_class)->finalize (object);
}
djvu_document_thumbnails_get_dimensions (document, page, width, &thumb_width, &thumb_height);
- if (border) {
- pixbuf = ev_document_misc_get_thumbnail_frame (thumb_width, thumb_height, NULL);
- pixels = gdk_pixbuf_get_pixels (pixbuf) + gdk_pixbuf_get_rowstride (pixbuf) + 4;
- } else {
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
- thumb_width, thumb_height);
- gdk_pixbuf_fill (pixbuf, 0xffffffff);
- pixels = gdk_pixbuf_get_pixels (pixbuf);
- }
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
+ thumb_width, thumb_height);
+ gdk_pixbuf_fill (pixbuf, 0xffffffff);
+ pixels = gdk_pixbuf_get_pixels (pixbuf);
while (ddjvu_thumbnail_status (djvu_document->d_document, page, 1) < DDJVU_JOB_OK) {
ddjvu_message_wait (djvu_document->d_context);
gdk_pixbuf_get_rowstride (pixbuf),
(gchar *)pixels);
- rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, rotation);
+ rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rotation);
g_object_unref (pixbuf);
+
+ if (border) {
+ GdkPixbuf *tmp_pixbuf = rotated_pixbuf;
+ rotated_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, 0, tmp_pixbuf);
+ g_object_unref (tmp_pixbuf);
+ }
return rotated_pixbuf;
}