From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.orgmode,gmane.emacs.bugs Subject: 24.0.92; (image-size ...) on "large" images Date: Tue, 31 Jan 2012 11:21:23 +0530 Message-ID: <81y5soxvvo.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1327989117 28143 80.91.229.3 (31 Jan 2012 05:51:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2012 05:51:57 +0000 (UTC) To: bug-gnu-emacs@gnu.org, Orgmode Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Tue Jan 31 06:51:56 2012 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rs6dI-0005c6-6p for geo-emacs-orgmode@m.gmane.org; Tue, 31 Jan 2012 06:51:56 +0100 Original-Received: from localhost ([::1]:59241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rs6dH-0003ni-N9 for geo-emacs-orgmode@m.gmane.org; Tue, 31 Jan 2012 00:51:55 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:56603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rs6d3-0003UI-VH for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 00:51:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rs6d1-0007YC-Cg for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 00:51:41 -0500 Original-Received: from mail-pw0-f41.google.com ([209.85.160.41]:53794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rs6d1-0007Y8-39; Tue, 31 Jan 2012 00:51:39 -0500 Original-Received: by pbaa12 with SMTP id a12so4805293pba.0 for ; Mon, 30 Jan 2012 21:51:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=Z91YSbJK8KP8/M1lN2FeItmFY2dp+wMbvpyyp6mEUE4=; b=bX13hYByFkIL6myQo8UK//stAfKt/J7C/R9h255nfYu8cY8URKlhLlrjS6HFvlWO52 8cOtkcywyBzTwCXystjTf56bqRwIefLRPFveiC+4C5DB7StG796U4Q30Ytgn87hx+MFA UhJi/qLyVEpN1AZg7vlFi1tCNkFQfJaO9K5nI= Original-Received: by 10.68.221.137 with SMTP id qe9mr2739161pbc.71.1327989097715; Mon, 30 Jan 2012 21:51:37 -0800 (PST) Original-Received: from JAMBU-NETBOOK ([115.242.236.195]) by mx.google.com with ESMTPS id j4sm52853467pbg.12.2012.01.30.21.51.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jan 2012 21:51:36 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.41 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.orgmode:51754 gmane.emacs.bugs:56289 Archived-At: org-odt.el relies on (image-size ...) to determine pixel dimensions of an image. For "large" images, this API returns "false" values. It would be wonderful, if Emacs returns just the true value of the image or nothing at all. On a related note, IIRC, during batch export there is no way I can use create-image + image-size to determine pixel dimensions of the image. Is there a reliable and uniform way to determine size of images that are *never* intended to be displayed. Original issue: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg51014.html My notes: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg51441.html ,---- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg51441.html | Re: [O] [ODT] image scaling overridden by long caption | | Jambunathan K | Mon, 30 Jan 2012 20:59:37 -0800 | | Andreas Leha writes: | | | >>> #+label: fig:baz | >>> #+name: baz | >>> #+attr_odt: :scale 0.5 | >>> #+header: :file baz.png | >>> #+header: :width 7200 :height 3600 :res 600 | >>> #+begin_src R :exports results :results graphics | >>> plot(1:10, 1:10) | >>> #+end_src | | Image that R outputs is 7200-by-3600. | | >> #+begin_src emacs-lisp | >> (list (* max-image-size (frame-pixel-width)) | >> (* max-image-size (frame-pixel-height))) | >> #+end_src | > | > #+results: | > | 3648.0 | 4320.0 | | | Emacs will "refuse to load" images that cannot fit in 3640-by-4320 | area. Note that max-image dimensions is "tightly coupled" with the frame | size. | | >> #+begin_src emacs-lisp | >> (message "%S" (ignore-errors | >> (image-size (create-image "baz.png") 'pixels))) | >> #+end_src | > | > #+results: | > : (30 . 30) | | Instead of loading a large image, Emacs tries to create a "safe" | 30-by-30 pixel area (whatver it is). | | The solution is to instruct Emacs to handle higher image sizes. Just | bump the value of max-image-size. For example, add this to init file. | | #+begin_src emacs-lisp | (setq max-image-size (* 2 max-image-size)) ;; modify scale | #+end_src `----