From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alan Third <alan@idiocy.org>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Image resizing and rotation on NS port without imagemagick
Date: Sun, 08 Oct 2017 22:53:28 +0200 [thread overview]
Message-ID: <m3k205pdiv.fsf@gnus.org> (raw)
In-Reply-To: <20171008203822.GA22846@breton.holly.idiocy.org> (Alan Third's message of "Sun, 8 Oct 2017 21:38:22 +0100")
Alan Third <alan@idiocy.org> 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
next prev parent reply other threads:[~2017-10-08 20:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 20:38 Image resizing and rotation on NS port without imagemagick Alan Third
2017-10-08 20:53 ` Lars Ingebrigtsen [this message]
2017-10-08 22:01 ` Alan Third
2017-10-11 18:27 ` Charles A. Roelli
2017-10-11 19:17 ` Alan Third
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3k205pdiv.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=alan@idiocy.org \
--cc=emacs-devel@gnu.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/emacs.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).