unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] system: grub: Use librsvg to convert SVG to PNG
Date: Tue, 25 Oct 2016 01:24:15 +0200	[thread overview]
Message-ID: <87oa29wctc.fsf@gnu.org> (raw)
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")

Hi!

ludo@gnu.org (Ludovic Courtès) skribis:

> Mark H Weaver <mhw@netris.org> 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 <mhw@netris.org>
>> 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	other threads:[~2016-10-24 23:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  8:02 [PATCH] system: grub: Use librsvg to convert SVG to PNG Mark H Weaver
2016-09-02 12:56 ` Ludovic Courtès
2016-10-24 23:24   ` Ludovic Courtès [this message]
2016-10-25  0:07     ` Leo Famulari
2016-10-31 21:57       ` Ludovic Courtès
2016-09-02 15:24 ` Vincent Legoll
2016-09-03 12:59   ` Vincent Legoll
2016-09-05  9:31     ` Vincent Legoll
2016-09-05 20:30 ` Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oa29wctc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).