emacs-devel
[Top][All Lists]
Advanced

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

Re: Auto-resizing of images in image-mode


From: Eli Zaretskii
Subject: Re: Auto-resizing of images in image-mode
Date: Fri, 17 Apr 2020 09:45:47 +0300

> From: Juri Linkov <address@hidden>
> Cc: address@hidden
> Date: Fri, 17 Apr 2020 00:53:48 +0300
> 
>   ** Image mode
> 
>   *** 'image-mode' now on resizing the window automatically resizes the
>       image to fit in the new dimensions of the window.

Something is wrong with that sentence ;-)

Also, please try to make the first line a complete sentence, so that
reading NEWS in Outline mode could be easier.  And I think we should
also say that the image will resize upon first display and whenever
the window's dimensions change.  This is implied by the text you
wrote, but it could be interpreted to mean the size is done once only,
when the file is visited.

> >   . Moreover, the manual makes a point of describing what cursor
> >     motion commands do when an image is displayed that is larger than
> >     the window, but this can no longer be seen when visiting an image
> >     file, because it is always smaller than the window.
> 
> It was difficult to find this place in the manual.

Sorry, I should have given better instructions.  In my defense, I
thought it was easy to find that place, since I found it immediately
by typing "i images RET" in Info.

> I propose to create a separate node "Images" or "Image mode".

Fine with me, but then let's describe in that node much more
image-related features than we have now.  The Image mode is nowadays
very feature-rich, and most of those features are not in the manual.

> But still can't find anything about motion commands in this node.

Sorry.  It's this text:

                                                     If the displayed
  image is wider or taller than the frame, the usual point motion keys
  (‘C-f’, ‘C-p’, and so forth) cause different parts of the image to be
  displayed.

> >   . There's no way to turn this behavior off, so it's practically
> >     impossible to view an image in its original size (unless you
> >     manually invoke insert-image).  It is not outlandish to envision
> >     users who might want to opt out.
> 
> It's impossible to view an image in its original size even without this 
> feature.
> A few years ago image-mode was changed to resize the image to fit in the
> window when visiting an image file.

Maybe so, but Emacs 26 still shows the images in their original size,
AFAICT.  So this is new in Emacs 27, at least for me.  I think that's
because previously the automatic resizing worked only in Emacs built
with ImageMagick, whereas in Emacs 27 we can resize natively.  I build
my Emacs without ImageMagick, and I wonder how many others do, due to
ImageMagick's instability.

Isn't it possible to have an option or a special command to visit an
image without the automatic resizing?  E.g., "C-u C-x C-f" could do
that for image files.

> What I added to this in emacs-27 is only to do the same (fit the
> image in the window) on window resizing as well.

Well, even if the window-relative resizing was not the cause of the
scaling, I think we should allow to disable such resizing, because in
Emacs 27 much more people will be exposed to this feature.

> There is an option 'image-transform-resize' added a long ago,
> but I don't understand its logic: when it's 'nil' then an image
> is resized initially after visiting.  And it has this comment:
> 
>   ;; FIXME this doesn't seem mature yet. Document in manual when it is.

AFAIU, it was implemented for ImageMagick only, and so it should be
rethought nowadays.

> Maybe a new emacs-27 feature (resize image on window resize) should
> depend on the same option using the same logic.  IOW, first we need
> to decide how to disable the initial image resizing, then use the
> same solution to disable the image resizing on window resize.

That's possible, yes.  My point is that we should have an option to
disable the resizing, so perhaps using this option as that knob will
do.  The resizing could be annoying in some special situations, for
example when the same image is displayed in two adjacent windows --
when you enlarge one window, the image shrinks because the other
window shrinks.

> >   . The time interval after which the idle timer resizes the image is
> >     fixed and cannot be customized.  The 1 sec interval looks too long
> >     to me, FWIW, but if it were customizable, my personal preferences
> >     would not have mattered.
> 
> A new option could be added with a name like image-transform-resize-delay.

Let's do that on the emacs-27 branch, please.

TIA



reply via email to

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