window-pixel-height's return value includes the mode line and header
line and the bottom divider, if any. In order for the image to fit
exactly, we therefore subtract window-header-line-height,
window-mode-line-height window, window-scroll-bar-height window, and
window-bottom-divider-width.
(window (get-buffer-window elpher-buffer-name)))
(when window
(setf (image-property image :max-width) (window-pixel-width window))
- (setf (image-property image :max-height) (window-pixel-height window)))
+ (setf (image-property image :max-height) (- (window-pixel-height window)
+ (window-header-line-height window)
+ (window-mode-line-height window)
+ (window-scroll-bar-height window)
+ (window-bottom-divider-width window))))
(elpher-with-clean-buffer
(insert-image image)
(elpher-restore-pos)))