guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] system: grub: Use librsvg to convert SVG to PNG


From: Ludovic Courtès
Subject: Re: [PATCH] system: grub: Use librsvg to convert SVG to PNG
Date: Tue, 25 Oct 2016 01:24:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi!

address@hidden (Ludovic Courtès) skribis:

> Mark H Weaver <address@hidden> 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’s excellent.  :-)
>> From a50f358b083cff4d156cd7116fee516952fc9bcf Mon Sep 17 00:00:00 2001
>> From: Mark H Weaver <address@hidden>
>> 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’d need to be autoloaded so that
> ‘make’ doesn’t fail when they’re missing, but that’s 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]