diff options
author | Andreas Müller <schnitzeltony@googlemail.com> | 2012-01-24 12:15:37 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-01-24 13:55:57 +0100 |
commit | 5c56ad8b357e722b0f8daa52e7da46ae0aa5c4cd (patch) | |
tree | 14b5ad332ff4af73b2e9e811d74dfea7d20b9dbc | |
parent | a388dabbcd734ecb6926c79c2a418613b9fff1dd (diff) | |
download | meta-openembedded-5c56ad8b357e722b0f8daa52e7da46ae0aa5c4cd.tar.gz |
gimp: initial add 2.6.11
* based on oe-classic [1]-[2]
* build tested incremental & from scratch in angstrom environment
* run tested on overo
[1] http://cgit.openembedded.org/openembedded/tree/recipes/gimp/gimp.inc
[2] http://cgit.openembedded.org/openembedded/tree/recipes/gimp/gimp_2.6.8.bb
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-rw-r--r-- | meta-oe/recipes-graphics/gimp/gimp/gimp-2.6.11-poppler18.patch | 150 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/gimp/gimp_2.6.11.bb | 24 |
2 files changed, 174 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gimp/gimp/gimp-2.6.11-poppler18.patch b/meta-oe/recipes-graphics/gimp/gimp/gimp-2.6.11-poppler18.patch new file mode 100644 index 0000000000..0ebfd89837 --- /dev/null +++ b/meta-oe/recipes-graphics/gimp/gimp/gimp-2.6.11-poppler18.patch | |||
@@ -0,0 +1,150 @@ | |||
1 | From 9b3e1c91fd2eac69da6947ec9c7fbf10096ba237 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mukund Sivaraman <muks@banu.com> | ||
3 | Date: Wed, 20 Apr 2011 13:25:44 +0000 | ||
4 | Subject: file-pdf-load: Don't use deprecated API (bug #646947) | ||
5 | |||
6 | Upstream-Status: Applied | ||
7 | |||
8 | --- | ||
9 | diff --git a/plug-ins/common/file-pdf-load.c b/plug-ins/common/file-pdf-load.c | ||
10 | index c2d5512..6183403 100644 | ||
11 | --- a/plug-ins/common/file-pdf.c | ||
12 | +++ b/plug-ins/common/file-pdf.c | ||
13 | @@ -4,6 +4,9 @@ | ||
14 | * | ||
15 | * Copyright (C) 2005 Nathan Summers | ||
16 | * | ||
17 | + * Some code borrowed from poppler.git/glib/poppler-page.cc | ||
18 | + * Copyright (C) 2005, Red Hat, Inc. | ||
19 | + * | ||
20 | * This program is free software; you can redistribute it and/or modify | ||
21 | * it under the terms of the GNU General Public License as published by | ||
22 | * the Free Software Foundation; either version 2 of the License, or | ||
23 | @@ -582,6 +585,84 @@ layer_from_pixbuf (gint32 image, | ||
24 | return layer; | ||
25 | } | ||
26 | |||
27 | +static void | ||
28 | +copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, | ||
29 | + GdkPixbuf *pixbuf) | ||
30 | +{ | ||
31 | + int cairo_width, cairo_height, cairo_rowstride; | ||
32 | + unsigned char *pixbuf_data, *dst, *cairo_data; | ||
33 | + int pixbuf_rowstride, pixbuf_n_channels; | ||
34 | + unsigned int *src; | ||
35 | + int x, y; | ||
36 | + | ||
37 | + cairo_width = cairo_image_surface_get_width (surface); | ||
38 | + cairo_height = cairo_image_surface_get_height (surface); | ||
39 | + cairo_rowstride = cairo_image_surface_get_stride (surface); | ||
40 | + cairo_data = cairo_image_surface_get_data (surface); | ||
41 | + | ||
42 | + pixbuf_data = gdk_pixbuf_get_pixels (pixbuf); | ||
43 | + pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf); | ||
44 | + pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf); | ||
45 | + | ||
46 | + if (cairo_width > gdk_pixbuf_get_width (pixbuf)) | ||
47 | + cairo_width = gdk_pixbuf_get_width (pixbuf); | ||
48 | + if (cairo_height > gdk_pixbuf_get_height (pixbuf)) | ||
49 | + cairo_height = gdk_pixbuf_get_height (pixbuf); | ||
50 | + | ||
51 | + for (y = 0; y < cairo_height; y++) | ||
52 | + { | ||
53 | + src = (unsigned int *) (cairo_data + y * cairo_rowstride); | ||
54 | + dst = pixbuf_data + y * pixbuf_rowstride; | ||
55 | + | ||
56 | + for (x = 0; x < cairo_width; x++) | ||
57 | + { | ||
58 | + dst[0] = (*src >> 16) & 0xff; | ||
59 | + dst[1] = (*src >> 8) & 0xff; | ||
60 | + dst[2] = (*src >> 0) & 0xff; | ||
61 | + | ||
62 | + if (pixbuf_n_channels == 4) | ||
63 | + dst[3] = (*src >> 24) & 0xff; | ||
64 | + | ||
65 | + dst += pixbuf_n_channels; | ||
66 | + src++; | ||
67 | + } | ||
68 | + } | ||
69 | +} | ||
70 | + | ||
71 | +static GdkPixbuf * | ||
72 | +render_page_to_pixbuf (PopplerPage *page, | ||
73 | + int width, | ||
74 | + int height, | ||
75 | + double scale) | ||
76 | +{ | ||
77 | + GdkPixbuf *pixbuf; | ||
78 | + cairo_surface_t *surface; | ||
79 | + cairo_t *cr; | ||
80 | + | ||
81 | + pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); | ||
82 | + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); | ||
83 | + cr = cairo_create (surface); | ||
84 | + | ||
85 | + cairo_save (cr); | ||
86 | + cairo_translate (cr, 0.0, 0.0); | ||
87 | + | ||
88 | + if (scale != 1.0) | ||
89 | + cairo_scale (cr, scale, scale); | ||
90 | + | ||
91 | + poppler_page_render (page, cr); | ||
92 | + cairo_restore (cr); | ||
93 | + | ||
94 | + cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); | ||
95 | + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); | ||
96 | + cairo_paint (cr); | ||
97 | + | ||
98 | + cairo_destroy (cr); | ||
99 | + copy_cairo_surface_to_pixbuf (surface, pixbuf); | ||
100 | + cairo_surface_destroy (surface); | ||
101 | + | ||
102 | + return pixbuf; | ||
103 | +} | ||
104 | + | ||
105 | static gint32 | ||
106 | load_image (PopplerDocument *doc, | ||
107 | const gchar *filename, | ||
108 | @@ -613,7 +694,7 @@ load_image (PopplerDocument *doc, | ||
109 | gdouble page_width; | ||
110 | gdouble page_height; | ||
111 | |||
112 | - GdkPixbuf *buf; | ||
113 | + GdkPixbuf *pixbuf; | ||
114 | gint width; | ||
115 | gint height; | ||
116 | |||
117 | @@ -643,15 +724,13 @@ load_image (PopplerDocument *doc, | ||
118 | gimp_image_set_resolution (image_ID, resolution, resolution); | ||
119 | } | ||
120 | |||
121 | - buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); | ||
122 | - | ||
123 | - poppler_page_render_to_pixbuf (page, 0, 0, width, height, scale, 0, buf); | ||
124 | + pixbuf = render_page_to_pixbuf (page, width, height, scale); | ||
125 | |||
126 | - layer_from_pixbuf (image_ID, page_label, i, buf, | ||
127 | + layer_from_pixbuf (image_ID, page_label, i, pixbuf, | ||
128 | doc_progress, 1.0 / pages->n_pages); | ||
129 | |||
130 | g_free (page_label); | ||
131 | - g_object_unref (buf); | ||
132 | + g_object_unref (pixbuf); | ||
133 | |||
134 | doc_progress = (double) (i + 1) / pages->n_pages; | ||
135 | gimp_progress_update (doc_progress); | ||
136 | @@ -729,11 +808,7 @@ get_thumbnail (PopplerDocument *doc, | ||
137 | width *= scale; | ||
138 | height *= scale; | ||
139 | |||
140 | - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, | ||
141 | - width, height); | ||
142 | - | ||
143 | - poppler_page_render_to_pixbuf (page, | ||
144 | - 0, 0, width, height, scale, 0, pixbuf); | ||
145 | + pixbuf = render_page_to_pixbuf (page, width, height, scale); | ||
146 | } | ||
147 | |||
148 | g_object_unref (page); | ||
149 | -- | ||
150 | cgit v0.9.0.2 | ||
diff --git a/meta-oe/recipes-graphics/gimp/gimp_2.6.11.bb b/meta-oe/recipes-graphics/gimp/gimp_2.6.11.bb new file mode 100644 index 0000000000..31e8925597 --- /dev/null +++ b/meta-oe/recipes-graphics/gimp/gimp_2.6.11.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | DESCRIPTION = "The GIMP is the GNU Image Manipulation Program." | ||
2 | HOMEPAGE = "http://www.gimp.org" | ||
3 | SECTION = "x11/graphics" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=878e3965c7b52d85827c75f5a2f3b314" | ||
6 | |||
7 | DEPENDS = "babl gdk-pixbuf-native libart-lgpl gtk+ jpeg libpng libexif tiff webkit-gtk lcms gegl poppler" | ||
8 | |||
9 | inherit gnome | ||
10 | |||
11 | SRC_URI = "ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-${PV}.tar.bz2 \ | ||
12 | file://gimp-2.6.11-poppler18.patch" | ||
13 | SRC_URI[md5sum] = "bb2939fe13e54fc7255cef5d097bb5dd" | ||
14 | SRC_URI[sha256sum] = "9b6d08d0803b3912ea596d1b77b9c21ee13778c23388a225c004b8c1587cb0a1" | ||
15 | |||
16 | EXTRA_OECONF = "--disable-python \ | ||
17 | --without-libwmf" | ||
18 | |||
19 | do_configure_append() { | ||
20 | find ${S} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g | ||
21 | find ${S} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g | ||
22 | } | ||
23 | |||
24 | FILES_${PN}-dbg += "${libdir}/gimp/2.0/*/.debug" | ||