From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] system: grub: Use librsvg to convert SVG to PNG Date: Tue, 25 Oct 2016 01:24:15 +0200 Message-ID: <87oa29wctc.fsf@gnu.org> References: <87lgzaloex.fsf@netris.org> <87fupilats.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byobN-0001N4-7s for guix-devel@gnu.org; Mon, 24 Oct 2016 19:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byobK-0006aL-3K for guix-devel@gnu.org; Mon, 24 Oct 2016 19:24:21 -0400 In-Reply-To: <87fupilats.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 02 Sep 2016 14:56:15 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org Hi! ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Mark H Weaver skribis: > >> The attached patch eliminates the use of 'inkscape' and 'imagemagick' to >> convert our grub background image from SVG to PNG. The job is now done >> using 'librsvg' [1] via Guile's dynamic FFI. I was unable to perform >> the needed scaling using the 'rsvg-convert' program, so I had to use >> librsvg directly. >> >> As a side benefit, the resulting image quality should be superior when >> scaling is performed, because scaling is now effectively done in the >> vector representation during rendering, whereas previously it was done >> in the raster representation as a separate step. >> >> What do you think? > > I think it=E2=80=99s excellent. :-) >> From a50f358b083cff4d156cd7116fee516952fc9bcf Mon Sep 17 00:00:00 2001 >> From: Mark H Weaver >> Date: Fri, 2 Sep 2016 02:26:43 -0400 >> Subject: [PATCH] system: grub: Use librsvg to convert SVG to PNG. >> >> * guix/build/svg.scm: New file. >> * Makefile.am (MODULES): Add it. >> * gnu/system/grub.scm (svg->png): Add 'width' and 'height' arguments. >> Reimplement using (guix build svg). Drop references to 'inkscape' and >> 'imagemagick'. >> (resize-image): Remove. >> (grub-background-image): Adapt to the incorporation of scaling into >> 'svg->png'. > > [...] > >> +(define-module (guix build svg) >> + #:use-module (ice-9 match) >> + #:use-module (system foreign) >> + #:use-module (rnrs bytevectors) >> + #:export (svg->png)) > > Is there are reason for not using guile-rsvg and guile-cairo? Otherwise > I think it would be preferable (they=E2=80=99d need to be autoloaded so t= hat > =E2=80=98make=E2=80=99 doesn=E2=80=99t fail when they=E2=80=99re missing,= but that=E2=80=99s OK.) > > I found an example that Andy had posted: > > https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00753.html I hacked this a little bit a pushed as ffde82c9ecf99524220e463055f4f18c8c9e7a81. Ludo=E2=80=99.