Commit f6474ec8 authored by Moritz Lipp's avatar Moritz Lipp

Merge branch 'release/0.2.9'

parents 748f626e a9286c6c
......@@ -2,7 +2,7 @@
VERSION_MAJOR = 0
VERSION_MINOR = 2
VERSION_REV = 8
VERSION_REV = 9
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
# minimum required zathura version
......
......@@ -37,25 +37,13 @@ pdf_page_render_to_buffer(mupdf_document_t* mupdf_document, mupdf_page_t* mupdf_
fz_rect rect = { .x1 = page_width, .y1 = page_height };
fz_colorspace* colorspace = fz_device_rgb(mupdf_document->ctx);
fz_pixmap* pixmap = fz_new_pixmap_with_bbox(mupdf_page->ctx, colorspace, &irect);
fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, &irect, image);
fz_clear_pixmap_with_value(mupdf_page->ctx, pixmap, 0xFF);
device = fz_new_draw_device(mupdf_page->ctx, pixmap);
fz_run_display_list(mupdf_page->ctx, display_list, device, &fz_identity, &rect, NULL);
fz_drop_device(mupdf_page->ctx, device);
unsigned char* s = fz_pixmap_samples(mupdf_page->ctx, pixmap);
unsigned int n = fz_pixmap_components(mupdf_page->ctx, pixmap);
for (unsigned int y = 0; y < fz_pixmap_height(mupdf_page->ctx, pixmap); y++) {
for (unsigned int x = 0; x < fz_pixmap_width(mupdf_page->ctx, pixmap); x++) {
guchar* p = image + y * rowstride + x * components;
p[0] = s[2];
p[1] = s[1];
p[2] = s[0];
s += n;
}
}
fz_drop_pixmap(mupdf_page->ctx, pixmap);
fz_drop_display_list(mupdf_page->ctx, display_list);
......
......@@ -17,7 +17,7 @@ Comment[pt_BR]=Um visualizador de documentos minimalista
Comment[ru]=Минималистичный просмотрщик документов
Comment[tr]=Minimalist bir belge görüntüleyicisi
Comment[uk_UA]=Легкий переглядач документів
Exec=zathura %f
Exec=zathura %U
Terminal=false
NoDisplay=true
Categories=Office;Viewer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment