[Top][All Lists]

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

Re: image scaling

From: Chong Yidong
Subject: Re: image scaling
Date: Thu, 21 Feb 2008 13:43:57 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Looking at the Elisp manual's "38.16.2 Image Descriptors", it seems that
> we do not support image scaling.
> I'd like to add such a feature to image-mode.el, but am wondering how we
> should go about doing it.  Would there be some advantage to provide it
> at the C level (e.g. if some of the image libs we use already provide
> the necessary functionality) or should we just bite the bullet and call
> some external tool like "convert -scale ..." (with the disadvantage that
> flushing the image cache will not automatically cause the image to be
> re-scaled).

I think the cleanest (but not necessarily easiest) approach is to add
a C level function to rescale an image.  This C function would act on
the internal pixmap structures and implement its own image scaling
algorithm.  The trouble with using external library functions is that
not all of them support rescaling.

Then we could simply add an extra "scale" argument to create-image
(and the underlying image descriptors), which, when non-nil, says to
scale the image by that amount.

reply via email to

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