GNU bug report logs - #58101
28.2; image-size nonsensical

Previous Next

Package: emacs;

Reported by: Thomas Hühn <t <at> 2uo.de>

Date: Mon, 26 Sep 2022 20:07:01 UTC

Severity: normal

Tags: notabug

Found in version 28.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58101 in the body.
You can then email your comments to 58101 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Mon, 26 Sep 2022 20:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Hühn <t <at> 2uo.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 26 Sep 2022 20:07:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; image-size nonsensical
Date: Mon, 26 Sep 2022 20:41:45 +0200

* Download image https://imgs.xkcd.com/comics/two_key_system_2x.png to
  disk

* Run (create-image "two_key_system_2x.png") --> (image :type png :file
  "two_key_system_2x.png" :scale 1.2038461538461538 :transform-smoothing
  t)

* Run (image-size (create-image "two_key_system_2x.png") :pixels) -->
  (30 . 30)

Expected result: (1291 . 632)


In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
 of 2022-09-13 built on fv-az448-195
Repository revision: ea87108e99fb3243a44af1a09a1a0c8f29a2ab37
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.22621
System Description: Microsoft Windows 10 Pro (v10.0.2009.22621.521)

Configured using:
 'configure --prefix=/mingw64 --build=x86_64-w64-mingw32 --with-modules
 --without-dbus --without-compress-install --with-native-compilation
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe'
 CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1 LDFLAGS=-pipe'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LIBXML2 MODULES NATIVE_COMP NOTIFY
W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM
ZLIB

Important settings:
  value of $LC_ALL: C.UTF8
  value of $LANG: en
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  rainbow-delimiters-mode: t
  recentf-mode: t
  savehist-mode: t
  save-place-mode: t
  electric-pair-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
c:/Users/redacted/AppData/Roaming/.emacs.d/elpa/transient-20220918.2101/transient 
hides c:/msys64/mingw64/share/emacs/28.2/lisp/transient
c:/redacted/Emacs/prolog hides 
c:/msys64/mingw64/share/emacs/28.2/lisp/progmodes/prolog

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
face-remap comp comp-cstr warnings cl-extra thingatpt help-fns
radix-tree cl-print debug backtrace help-mode paredit
image-dimensions-minor-mode rainbow-delimiters finder-inf
org-noter-pdftools org-pdftools pdf-occur ibuf-ext ibuffer
ibuffer-loaddefs pdf-isearch let-alist pdf-annot tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet facemenu pdf-misc imenu pdf-tools compile
cus-edit cus-load pdf-view bookmark text-property-search pp jka-compr
pdf-cache pdf-info tq pdf-util image-mode dired dired-loaddefs exif
org-noter org-element avl-tree generator org-id org-refile org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete comint ansi-color ring org-list
org-faces org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex iso8601
time-date ol rx org-keys oc org-compat advice org-macs org-loaddefs
format-spec find-func cal-menu calendar cal-loaddefs pdf-loader recentf
tree-widget wid-edit savehist saveplace edmacro kmacro elec-pair
slime-autoloads info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 699091 31870)
 (symbols 48 27290 1)
 (strings 32 129618 5666)
 (string-bytes 1 3868314)
 (vectors 16 62928)
 (vector-slots 8 1171894 47516)
 (floats 8 199 58)
 (intervals 56 520 70)
 (buffers 992 19))

-- 
Wunderschön illustrierte Kinderbücher:
https://www.schoene-kinderbuecher.de
Weblog:
https://www.thomas-huehn.de




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 06:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 09:05:18 +0300
> Date: Mon, 26 Sep 2022 20:41:45 +0200
> From: Thomas Hühn <t <at> 2uo.de>
> 
> * Download image https://imgs.xkcd.com/comics/two_key_system_2x.png to
>    disk
> 
> * Run (create-image "two_key_system_2x.png") --> (image :type png :file
>    "two_key_system_2x.png" :scale 1.2038461538461538 :transform-smoothing
>    t)
> 
> * Run (image-size (create-image "two_key_system_2x.png") :pixels) -->
>    (30 . 30)
> 
> Expected result: (1291 . 632)

I cannot reproduce this here.  I get the expected result.  I also get
this result from create-image:

 (image :type png :file "two_key_system_2x.png" :scale 1 :transform-smoothing t)


Is this in "emacs -Q"?  If so, what version of libpng do you have
installed there?  And what happens if you start Emacs like this:

  emacs -Q --eval "(setq w32-use-native-image-API t)"

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 09:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 12:19:04 +0300
> Date: Tue, 27 Sep 2022 11:00:22 +0200
> From: Thomas Hühn <t <at> 2uo.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>
> 
> After some googling I found image-scaling-factor, and after setting that 
> to 1, I always get the expected 1291 . 632 now.

So the issue happens because image-scaling-factor is different from 1?
If so, this doesn't seem to be a bug, does it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 09:40:01 GMT) Full text and rfc822 format available.

Message #14 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 12:39:00 +0300
> Date: Tue, 27 Sep 2022 11:21:46 +0200
> Cc: 58101 <at> debbugs.gnu.org
> From: Thomas Hühn <t <at> 2uo.de>
> 
> On 27.09.2022 11:19, Eli Zaretskii wrote:
> >> Date: Tue, 27 Sep 2022 11:00:22 +0200
> >> From: Thomas Hühn <t <at> 2uo.de>
> >> Cc: Eli Zaretskii <eliz <at> gnu.org>
> >>
> >> After some googling I found image-scaling-factor, and after setting that
> >> to 1, I always get the expected 1291 . 632 now.
> > 
> > So the issue happens because image-scaling-factor is different from 1?
> > If so, this doesn't seem to be a bug, does it?
> 
> I cannot reproduce the bug today, but the result until yesterday (as 
> written in the bug report) was wrong, even taking image-scaling-factor 
> into account (30 . 30).

Well, we need a reproducible recipe to investigate, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 11:58:02 GMT) Full text and rfc822 format available.

Message #17 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Thomas Hühn <t <at> 2uo.de>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 13:57:16 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> >> After some googling I found image-scaling-factor, and after setting that
>> >> to 1, I always get the expected 1291 . 632 now.
>> > 
>> > So the issue happens because image-scaling-factor is different from 1?
>> > If so, this doesn't seem to be a bug, does it?
>> 
>> I cannot reproduce the bug today, but the result until yesterday (as 
>> written in the bug report) was wrong, even taking image-scaling-factor 
>> into account (30 . 30).
>
> Well, we need a reproducible recipe to investigate, I think.

Can you try

(image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 1.4) :pixels)

It rather sounds like `image-size' on Windows doesn't work when there's
scaling involved and then reports the size in character units instead.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 12:15:02 GMT) Full text and rfc822 format available.

Message #20 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: t <at> 2uo.de, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 15:14:41 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Thomas Hühn <t <at> 2uo.de>,  58101 <at> debbugs.gnu.org
> Date: Tue, 27 Sep 2022 13:57:16 +0200
> 
> Can you try
> 
> (image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 1.4) :pixels)

I get (1808 . 885).

> It rather sounds like `image-size' on Windows doesn't work when there's
> scaling involved and then reports the size in character units instead.

I don't see it here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 12:29:01 GMT) Full text and rfc822 format available.

Message #23 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:28:13 +0200
Thomas Hühn <t <at> 2uo.de> writes:

> With emacs -Q:
>
> (image-size (create-image "two_key_system_2x.png") :pixels)
>
> --> (1549 . 758)

You previously said:

* Run (image-size (create-image "two_key_system_2x.png") :pixels) -->
  (30 . 30)

So has this bug gone away?  Or didn't you use "-Q" before?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 12:38:01 GMT) Full text and rfc822 format available.

Message #26 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:36:55 +0200
Thomas Hühn <t <at> 2uo.de> writes:

> Yes, I couldn't reproduce my bug today at all. It occurred until
> yesterday (and several times in the weeks before that).
>
> Is 30 . 30 a special value? It seems strange that Markus Triska got
> the same value on Mac years ago.

30x30 is the default size for images that can't be displayed.  For
instance, 

(image-size (create-image "/tmp/DOES-NOT-EXIST.png" nil nil :scale 1.0) t)
=> (30 . 30)

So I think perhaps you just didn't have the image in the current
directory when you did the create-image.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 12:52:01 GMT) Full text and rfc822 format available.

Message #29 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thomas Hühn <t <at> 2uo.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:51:22 +0200
Thomas Hühn <t <at> 2uo.de> writes:

>> 30x30 is the default size for images that can't be displayed.  For
>> instance, 
>> 
>> (image-size (create-image "/tmp/DOES-NOT-EXIST.png" nil nil :scale 1.0) t)
>> => (30 . 30)
>> 
>> So I think perhaps you just didn't have the image in the current
>> directory when you did the create-image.
>
> Thanks!

OK; I'm closing this bug report, then.




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 12:52:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 58101 <at> debbugs.gnu.org and Thomas Hühn <t <at> 2uo.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 12:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 14:29:01 GMT) Full text and rfc822 format available.

Message #36 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Thomas Hühn <t <at> 2uo.de>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 10:28:44 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> (image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 1.4) :pixels)

Hmm, that evaluates to "(30 . 30)" here, even though I don't even have a
file named "/tmp/two_key_system_2x.png".

Isn't that a bug?  I'd expect it to signal an error.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 15:42:02 GMT) Full text and rfc822 format available.

Message #39 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Thomas Hühn <t <at> 2uo.de>, Eli Zaretskii <eliz <at> gnu.org>,
 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 17:41:25 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Hmm, that evaluates to "(30 . 30)" here, even though I don't even have a
> file named "/tmp/two_key_system_2x.png".
>
> Isn't that a bug?  I'd expect it to signal an error.

It doesn't check whether the image exists until doing redisplay
normally (and then logs the problem in *Messages*)...  But `image-size'
could certainly signal an error in these cases, I guess.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 15:43:01 GMT) Full text and rfc822 format available.

Message #42 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: t <at> 2uo.de, larsi <at> gnus.org, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 18:42:00 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 27 Sep 2022 10:28:44 -0400
> Cc: Thomas Hühn <t <at> 2uo.de>, 58101 <at> debbugs.gnu.org
> 
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> 
> > (image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 1.4) :pixels)
> 
> Hmm, that evaluates to "(30 . 30)" here, even though I don't even have a
> file named "/tmp/two_key_system_2x.png".
> 
> Isn't that a bug?  I'd expect it to signal an error.

No, that's the normal reaction in case of failure to create an image.
I think it will signal an error if you try to display it or something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 16:34:02 GMT) Full text and rfc822 format available.

Message #45 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: 58101 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 11:00:22 +0200
Hi,

first of all, I think this bug could be merged with #52931, I found that 
only afterwards.

On 27.09.2022 08:05, Eli Zaretskii wrote:
>> Date: Mon, 26 Sep 2022 20:41:45 +0200
>> From: Thomas Hühn <t <at> 2uo.de>
>>
>> * Download image https://imgs.xkcd.com/comics/two_key_system_2x.png to
>>     disk
>>
>> * Run (create-image "two_key_system_2x.png") --> (image :type png :file
>>     "two_key_system_2x.png" :scale 1.2038461538461538 :transform-smoothing
>>     t)
>>
>> * Run (image-size (create-image "two_key_system_2x.png") :pixels) -->
>>     (30 . 30)
>>
>> Expected result: (1291 . 632)
> 
> I cannot reproduce this here.  I get the expected result.  I also get

Now it seems like it's an intermittent problem.

Until yesterday (for several weaks where I've tried it every now and 
then) it resulted in what I wrote in this bug.

Then I found #52931 and tried Markus' lines.

In my opinion,

(image-size (create-image "two_key_system_2x.png") :pixels)

and

(let ((img (create-image "two_key_system_2x.png")))
  (image-size img t))

should give the same result, but it didn't! Markus' line gave 1554 . 
760, mine gave 30 . 30.

Later yesterday evening both gave 1554 . 760.

After some googling I found image-scaling-factor, and after setting that 
to 1, I always get the expected 1291 . 632 now.

(By the way, I think image-size should ignore that variable – I'm not 
displaying the image anywhere, so any display scaling shouldn't 
interfere – my use case would be inserting width and height attributes 
in HTML where I certainly want the original image dimensions)

> this result from create-image:
> 
>   (image :type png :file "two_key_system_2x.png" :scale 1 :transform-smoothing t)

With emacs -Q:

(image :type png :file "two_key_system_2x.png" :scale 1.2 
:transform-smoothing t)

That scaling factor is different now. I'll continue with emacs -Q from 
now on.

> Is this in "emacs -Q"?  If so, what version of libpng do you have

mingw64/mingw-w64-x86_64-libpng 1.6.38-1 [installed]

> installed there?  And what happens if you start Emacs like this:
> 
>    emacs -Q --eval "(setq w32-use-native-image-API t)"

(image-size (create-image "two_key_system_2x.png") :pixels)
--> (1549 . 758)

(let ((img (create-image "two_key_system_2x.png")))
  (image-size img t))
--> (1549 . 758)

Have a nice day!
Thomas
-- 
Wunderschön illustrierte Kinderbücher:
https://www.schoene-kinderbuecher.de
Weblog:
https://www.thomas-huehn.de




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 16:34:02 GMT) Full text and rfc822 format available.

Message #48 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 11:21:46 +0200
On 27.09.2022 11:19, Eli Zaretskii wrote:
>> Date: Tue, 27 Sep 2022 11:00:22 +0200
>> From: Thomas Hühn <t <at> 2uo.de>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>
>>
>> After some googling I found image-scaling-factor, and after setting that
>> to 1, I always get the expected 1291 . 632 now.
> 
> So the issue happens because image-scaling-factor is different from 1?
> If so, this doesn't seem to be a bug, does it?

I cannot reproduce the bug today, but the result until yesterday (as 
written in the bug report) was wrong, even taking image-scaling-factor 
into account (30 . 30).
-- 
Wunderschön illustrierte Kinderbücher:
https://www.schoene-kinderbuecher.de
Weblog:
https://www.thomas-huehn.de




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 16:34:03 GMT) Full text and rfc822 format available.

Message #51 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:25:34 +0200
On 27.09.2022 13:57, Lars Ingebrigtsen wrote:
> Can you try
> 
> (image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 1.4) :pixels)
> 
> It rather sounds like `image-size' on Windows doesn't work when there's
> scaling involved and then reports the size in character units instead.


With emacs -Q:

(image-size (create-image "two_key_system_2x.png") :pixels)

--> (1549 . 758)


(let ((img (create-image "two_key_system_2x.png")))
  (image-size img t))

--> (1549 . 758)

(image-size (create-image "/tmp/two_key_system_2x.png" nil nil :scale 
1.4) :pixels)

--> (1807 . 884)

Thanks!
Thomas
-- 
Wunderschön illustrierte Kinderbücher:
https://www.schoene-kinderbuecher.de
Weblog:
https://www.thomas-huehn.de




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 16:34:03 GMT) Full text and rfc822 format available.

Message #54 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:30:57 +0200
Yes, I couldn't reproduce my bug today at all. It occurred until yesterday (and several times in the weeks before that).

Is 30 . 30 a special value? It seems strange that Markus Triska got the same value on Mac years ago.

Thomas
-- 
Wunderschön illustrierte Kinderbücher:
https://www.schoene-kinderbuecher.de
Weblog:
https://www.thomas-huehn.de

> Am 27.09.2022 um 14:28 schrieb Lars Ingebrigtsen <larsi <at> gnus.org>:
> 
> Thomas Hühn <t <at> 2uo.de> writes:
> 
>> With emacs -Q:
>> 
>> (image-size (create-image "two_key_system_2x.png") :pixels)
>> 
>> --> (1549 . 758)
> 
> You previously said:
> 
> * Run (image-size (create-image "two_key_system_2x.png") :pixels) -->
>  (30 . 30)
> 
> So has this bug gone away?  Or didn't you use "-Q" before?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58101; Package emacs. (Tue, 27 Sep 2022 16:34:03 GMT) Full text and rfc822 format available.

Message #57 received at 58101 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Hühn <t <at> 2uo.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58101 <at> debbugs.gnu.org
Subject: Re: bug#58101: 28.2; image-size nonsensical
Date: Tue, 27 Sep 2022 14:50:14 +0200
> 
> 30x30 is the default size for images that can't be displayed.  For
> instance, 
> 
> (image-size (create-image "/tmp/DOES-NOT-EXIST.png" nil nil :scale 1.0) t)
> => (30 . 30)
> 
> So I think perhaps you just didn't have the image in the current
> directory when you did the create-image.

Thanks!

Thomas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Oct 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.