all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Ivan Andrus <darthandrus@gmail.com>
Cc: 12506@debbugs.gnu.org
Subject: bug#12506: 24.2.50; Docview shrinks width to fit screen
Date: Tue, 25 Sep 2012 10:39:39 +0200	[thread overview]
Message-ID: <871uhqebsk.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: <3B2F4906-4358-4789-8168-594D8D8337A2@gmail.com> (Ivan Andrus's message of "Mon, 24 Sep 2012 20:17:37 +0200")

Ivan Andrus <darthandrus@gmail.com> writes:

> I occasionally use doc-view-mode to read pdfs.  I have noticed that if
> the window is skinnier than the width of the pdf then the width is
> shrunk so that it all fits.  However, the height is not affected.
> This leads to "squished" text which is unreadable.
>
> To see the effect:
>
> 1. emacs -Q
> 2. open a pdf in doc-view-mode
> 3. type "W" for `doc-view-fit-width-to-window'
> 4. C-x 3 to split the window
> 5. You now have a squished picture.
>
> I think it should not scale the width at all (and it did not use to).
> It makes zooming in impossible.  Especially it should not scale the
> width without scaling the height.

I can't reproduce that on a GNU/Linux box.  After step 3, the image fits
exactly the width of the emacs window and the height is set correctly to
keep the aspect ratio.  After step 4, I have two side-by-side windows,
each showing about the left half of the image, but no squishing.

Have you compiled emacs with ImageMagick support?  I guess so, because
else doc-view would fall back to reconversion with any zooming command.
So let's assume you have ImageMagick support, could you please evaluate

  ;; That's basically what doc-view with ImageMagic does when
  ;; fitting/zooming
  (insert-image
   (create-image "/some/image.png"
	         'imagemagick nil :width 100))

and play a bit with the width parameter?  In any case, the image should
keep its original aspect ratio.

,----[ (info "(elisp)ImageMagick Images") ]
| `:width, :height'
|      The `:width' and `:height' keywords are used for scaling the
|      image.  If only one of them is specified, the other one will be
|      calculated so as to preserve the aspect ratio.  If both are
|      specified, aspect ratio may not be preserved.
`----

If you don't have ImageMagick support, could you check if just finding
some png image with image-mode and then splitting has the same squish
effect?

Bye,
Tassilo





  reply	other threads:[~2012-09-25  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 18:17 bug#12506: 24.2.50; Docview shrinks width to fit screen Ivan Andrus
2012-09-25  8:39 ` Tassilo Horn [this message]
2012-09-25 13:14   ` Ivan Andrus
2012-09-25 13:56     ` Tassilo Horn
2012-09-25 16:12       ` Glenn Morris
2012-10-07 11:10       ` Jan Djärv
2012-10-08 13:22         ` Ivan Andrus

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871uhqebsk.fsf@thinkpad.tsdh.de \
    --to=tsdh@gnu.org \
    --cc=12506@debbugs.gnu.org \
    --cc=darthandrus@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.