[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Image resizing and rotation on NS port without imagemagick
From: |
Lars Ingebrigtsen |
Subject: |
Re: Image resizing and rotation on NS port without imagemagick |
Date: |
Sun, 08 Oct 2017 22:53:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Alan Third <address@hidden> writes:
> It’s always kind of bugged me that I need imagemagick to do image
> resizing when Cocoa and GNUstep support it natively, so I’ve finally
> got round to implementing it.
Allowing all the other image formats to support scaling and stuff would
be very nice, but this is just for the Apple port? I think if Emacs has
(for instance) .png scaling, it should preferably be supported across
all architectures...
> +- (void)setSizeFromSpec: (Lisp_Object) spec
> +{
> + NSSize size = [self size];
> + Lisp_Object value;
> + double scale = 1, aspect = size.width / size.height;
> + double width = -1, height = -1, max_width = -1, max_height = -1;
> +
> + value = Fplist_get (spec, QCscale);
> + if (NUMBERP (value))
> + scale = XFLOATINT (value) ;
[...]
> + [self setSize:NSMakeSize(width, height)];
(Etc.) This function seems to replicate the functionality of
compute_image_size in image.c? Is there any reason why that couldn't
just be reused here, too? (Perhaps the calling conventions would need
to be tweaked a bit...)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no