unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display
@ 2014-02-22  1:00 N. Jackson
  2014-02-24 17:54 ` N. Jackson
  2016-03-03 21:21 ` N. Jackson
  0 siblings, 2 replies; 5+ messages in thread
From: N. Jackson @ 2014-02-22  1:00 UTC (permalink / raw)
  To: 16839

Recipe:
=======
This recipe requires an image file bigger than the display (I used a
2048 x 1536 pixel JPEG file on a display with a resolution of 1366 x 768).

1. emacs -Q
2. C-x C-f big-image.jpg
3. M-x image-mode-fit-frame

Expected behaviour:
===================
Frame size increases to the maximum size that will fit on the display.

Actual behaviour:
=================
Frame size increases to a size slightly less that the maximum that will
fit on the display. There is a gap above the frame of about the height
of the title bar, a gap below the frame about a pixel high, and a gap to
the left of the frame maybe three pixels wide.

Furthermore, the size of this frame does not seem to be recorded
wherever such parameters normally are (in Emacs or the windowing
system?), so that if I maximise the frame (logo key and up arrow) and
then "restore" it (logo key and down arrow), it does not return to the
size it was before I maximised it, nor to the size it was before I
issued the image-mode-fit-frame command, but to some intermediate size.

Additional Comments:
====================
The name of the command image-mode-fit-frame seems ill-chosen. This is
not intended to fit the image to the frame, but rather the frame to the
image. The text on the menu -- "Fit Frame to Image" -- is clear. This
suggests the command should be called image-mode-fit-frame-to-image.


In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.8)
 of 2014-02-19 on moondust
Repository revision: 116484 lekktu@gmail.com-20140219210406-y2s7lx244ojfl5on
Windowing system distributor `Fedora Project', version 11.0.11404000
System Description:	Fedora release 19 (Schrödinger’s Cat)

Configured using:
 `configure --prefix=/home/nlj/local/'

Important settings:
  value of $LC_MONETARY: en_DK.utf8
  value of $LC_NUMERIC: en_DK.utf8
  value of $LC_TIME: en_DK.utf8
  value of $LANG: en_CA.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Image[jpeg]

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils help-mode image-mode easymenu time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display
  2014-02-22  1:00 bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display N. Jackson
@ 2014-02-24 17:54 ` N. Jackson
  2016-03-03 21:21 ` N. Jackson
  1 sibling, 0 replies; 5+ messages in thread
From: N. Jackson @ 2014-02-24 17:54 UTC (permalink / raw)
  To: 16839

At 21:00 -0400 on Friday 2014-02-21, N. Jackson wrote:

> 1. emacs -Q
> 2. C-x C-f big-image.jpg
> 3. M-x image-mode-fit-frame

> Frame size increases to a size slightly less that the maximum that will
> fit on the display. There is a gap above the frame of about the height
> of the title bar, a gap below the frame about a pixel high, and a gap to
> the left of the frame maybe three pixels wide.

Setting frame-resize-pixelwise to t works around this problem.

> Furthermore, the size of this frame does not seem to be recorded
> wherever such parameters normally are (in Emacs or the windowing
> system?), so that if I maximise the frame (logo key and up arrow) and
> then "restore" it (logo key and down arrow), it does not return to the
> size it was before I maximised it, nor to the size it was before I
> issued the image-mode-fit-frame command, but to some intermediate size.

But frame-resize-pixelwise doesn't help with the frame not "remembering"
what size to restore to.







^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display
  2014-02-22  1:00 bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display N. Jackson
  2014-02-24 17:54 ` N. Jackson
@ 2016-03-03 21:21 ` N. Jackson
  2019-09-26 17:03   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: N. Jackson @ 2016-03-03 21:21 UTC (permalink / raw)
  To: 16839

At 21:00 -0400 on Friday 2014-02-21, N. Jackson wrote:
>
> Recipe:
> =======
> This recipe requires an image file bigger than the display (I used
> a 2048 x 1536 pixel JPEG file on a display with a resolution of
> 1366 x 768).
>
> 1. emacs -Q
> 2. C-x C-f big-image.jpg
> 3. M-x image-mode-fit-frame

Just a quick update on this bug report.

The recipe I provided above doesn't work on Emacs 25 (currently
testing on the second pretest 25.0.92) because it seems that images
are now shrunk to fit into the frame when they are opened.

In any case the image-mode-fit-frame function still seems to be
broken. The documented behaviour is:

    If called interactively, or if TOGGLE is non-nil, toggle between
    fitting FRAME to the current image and restoring the size and
    window configuration prior to the last ‘image-mode-fit-frame’
    call.

The toggling makes it slightly confusing to figure out what's going
on but it seems that the function is only doing half of its job.

When it needs to adjust only the height of the frame and when it
needs to adjust only the width of the frame, the function seems to
work correctly. But when it needs to adjust both the height and the
width, it only adjusts the height and fails to adjust the width.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display
  2016-03-03 21:21 ` N. Jackson
@ 2019-09-26 17:03   ` Lars Ingebrigtsen
  2019-10-14  7:27     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-26 17:03 UTC (permalink / raw)
  To: N. Jackson; +Cc: 16839

nljlistbox2@gmail.com (N. Jackson) writes:

> In any case the image-mode-fit-frame function still seems to be
> broken. The documented behaviour is:
>
>     If called interactively, or if TOGGLE is non-nil, toggle between
>     fitting FRAME to the current image and restoring the size and
>     window configuration prior to the last ‘image-mode-fit-frame’
>     call.
>
> The toggling makes it slightly confusing to figure out what's going
> on but it seems that the function is only doing half of its job.
>
> When it needs to adjust only the height of the frame and when it
> needs to adjust only the width of the frame, the function seems to
> work correctly. But when it needs to adjust both the height and the
> width, it only adjusts the height and fails to adjust the width.

I'm not quite sure whether I'm reproducing this right...  If I `C-x C-f'
a big image file, then readjust the Emacs frame to be smaller than that
image, and then say `M-x image-mode-fit-frame', it does expand both
width and height to fit that image as displayed.

Are you still seeing this problem in Emacs 27?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display
  2019-09-26 17:03   ` Lars Ingebrigtsen
@ 2019-10-14  7:27     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-14  7:27 UTC (permalink / raw)
  To: N. Jackson; +Cc: 16839

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm not quite sure whether I'm reproducing this right...  If I `C-x C-f'
> a big image file, then readjust the Emacs frame to be smaller than that
> image, and then say `M-x image-mode-fit-frame', it does expand both
> width and height to fit that image as displayed.
>
> Are you still seeing this problem in Emacs 27?

More information was requested some weeks back, but no response was
given, so I'm closing this bug report.  If you're still seeing this
problem, please reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-14  7:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-22  1:00 bug#16839: 24.3.50; image-mode-fit-frame fails to use all display space with image larger than display N. Jackson
2014-02-24 17:54 ` N. Jackson
2016-03-03 21:21 ` N. Jackson
2019-09-26 17:03   ` Lars Ingebrigtsen
2019-10-14  7:27     ` Lars Ingebrigtsen

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).