unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
@ 2007-04-25  2:05 Richard Stallman
  2007-04-25  4:57 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Richard Stallman @ 2007-04-25  2:05 UTC (permalink / raw)
  To: emacs-devel

Would someone please install this, then ack to him and me?

------- Start of forwarded message -------
X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS,
	UNPARSEABLE_RELAY autolearn=failed version=3.1.0
To: emacs-pretest-bug@gnu.org
From: Mathias Dahl <mathias.dahl@gmail.com>
Date: Tue, 24 Apr 2007 20:18:10 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: Re: Tumme fails with default custom settings

Richard Stallman <rms@gnu.org> writes:

>     I was able to recreate this, but only for "small" images. Not sure yet
>     if there is a certain limit or if it is variable. The same problem can
>     be seen if you do C-u RET instead of RET in the thumbnail buffer.
>
>     I cannot say if this ever worked because I think that each time I have
>     tested this command I have done it with an image which is larger than
>     the Emacs window.
>
> Can you fix it?

Yes. The cause of the problem was that when displaying the image in
its original size, no conversion was needed, and therefore the image
format was not always JPEG (JPEG this was hardcoded in the previous
version of the defun below, now it is replaced by a variable). 

The new version below takes care of this case and uses
`image-type-from-file-name' to determine the image type. This solves
the problem for PNG and XPM files (the ones I could test that wasn't
JPEG) but GIF does not seem to be possible to insert. Is this on
purpose?

Anyway, this fixes the parent poster's problem but not the problem the
original poster had (that I was not able to reproduce, yet).

Replace `image-dired-display-image' in image-dired.el with the fixed
version below:

;;; code begins here

(defun image-dired-display-image (file &optional original-size)
  "Display image FILE in image buffer.
Use this when you want to display the image, semi sized, in a new
window.  The image is sized to fit the display window (using a
temporary file, don't worry).  Because of this, it will not be as
quick as opening it directly, but on most modern systems it
should feel snappy enough.

If optional argument ORIGINAL-SIZE is non-nil, display image in its
original size."
  (let ((new-file (expand-file-name image-dired-temp-image-file))
        width height command ret
        (image-type 'jpeg))
    (setq file (expand-file-name file))
    (if (not original-size)
        (progn
          (setq width (image-dired-display-window-width))
          (setq height (image-dired-display-window-height))
          (setq command
                (format-spec
                 image-dired-cmd-create-temp-image-options
                 (list
                  (cons ?p image-dired-cmd-create-temp-image-program)
                  (cons ?w width)
                  (cons ?h height)
                  (cons ?f file)
                  (cons ?t new-file))))
          (setq ret (call-process shell-file-name nil nil nil
				  shell-command-switch command))
          (if (not (= 0 ret))
              (error "Could not resize image")))
      (setq image-type (image-type-from-file-name file))
      (copy-file file new-file t))
    (with-current-buffer (image-dired-create-display-image-buffer)
      (let ((inhibit-read-only t))
        (erase-buffer)
        (clear-image-cache)
        (image-dired-insert-image image-dired-temp-image-file image-type 0 0)
        (goto-char (point-min))
        (image-dired-update-property 'original-file-name file)))))

;;; code ends here

/Mathias



_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  2:05 [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings] Richard Stallman
@ 2007-04-25  4:57 ` Glenn Morris
  2007-04-25  7:47 ` Mathias Dahl
  2007-04-26  2:56 ` Glenn Morris
  2 siblings, 0 replies; 16+ messages in thread
From: Glenn Morris @ 2007-04-25  4:57 UTC (permalink / raw)
  To: rms, mathias.dahl; +Cc: emacs-devel

Richard Stallman wrote:

> Would someone please install this, then ack to him and me?

installed on trunk and branch

> From: Mathias Dahl <mathias.dahl@gmail.com>
> Subject: Re: Tumme fails with default custom settings
> To: emacs-pretest-bug@gnu.org
> Date: Tue, 24 Apr 2007 20:18:10 +0200

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  2:05 [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings] Richard Stallman
  2007-04-25  4:57 ` Glenn Morris
@ 2007-04-25  7:47 ` Mathias Dahl
  2007-04-25  7:51   ` David Kastrup
                     ` (2 more replies)
  2007-04-26  2:56 ` Glenn Morris
  2 siblings, 3 replies; 16+ messages in thread
From: Mathias Dahl @ 2007-04-25  7:47 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> Yes. The cause of the problem was that when displaying the image in
> its original size, no conversion was needed, and therefore the image
> format was not always JPEG (JPEG this was hardcoded in the previous
> version of the defun below, now it is replaced by a variable).
>
> The new version below takes care of this case and uses
> `image-type-from-file-name' to determine the image type. This solves
> the problem for PNG and XPM files (the ones I could test that wasn't
> JPEG) but GIF does not seem to be possible to insert. Is this on
> purpose?

Richard, can you comment on the GIF issue above? I am suspecting that
the old patent on the LZW compression algorithm has something to do
with it (http://www.gnu.org/philosophy/gif.html). Does it? When
opening JPEG and PNG files from Dired, I automaticaly see the image,
and this does not happen with GIF.

I just want to have this verified so that I don't have to hunt for
more bugs in image-dired (it feel strange not to type "tumme"
anymore...).

/Mathias

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  7:47 ` Mathias Dahl
@ 2007-04-25  7:51   ` David Kastrup
  2007-04-25 14:03     ` Mathias Dahl
  2007-04-25 10:10   ` Tassilo Horn
  2007-04-26  4:23   ` Richard Stallman
  2 siblings, 1 reply; 16+ messages in thread
From: David Kastrup @ 2007-04-25  7:51 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: rms, emacs-devel

"Mathias Dahl" <mathias.dahl@gmail.com> writes:

>> Yes. The cause of the problem was that when displaying the image in
>> its original size, no conversion was needed, and therefore the image
>> format was not always JPEG (JPEG this was hardcoded in the previous
>> version of the defun below, now it is replaced by a variable).
>>
>> The new version below takes care of this case and uses
>> `image-type-from-file-name' to determine the image type. This solves
>> the problem for PNG and XPM files (the ones I could test that wasn't
>> JPEG) but GIF does not seem to be possible to insert. Is this on
>> purpose?
>
> Richard, can you comment on the GIF issue above? I am suspecting that
> the old patent on the LZW compression algorithm has something to do
> with it (http://www.gnu.org/philosophy/gif.html). Does it? When
> opening JPEG and PNG files from Dired, I automaticaly see the image,
> and this does not happen with GIF.

Possibly depends on the libraries your Emacs has been compiled with.
What is the output of
(image-type-available-p 'gif)
?

-- 
David Kastrup

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  7:47 ` Mathias Dahl
  2007-04-25  7:51   ` David Kastrup
@ 2007-04-25 10:10   ` Tassilo Horn
  2007-04-26  4:23   ` Richard Stallman
  2 siblings, 0 replies; 16+ messages in thread
From: Tassilo Horn @ 2007-04-25 10:10 UTC (permalink / raw)
  To: emacs-devel

"Mathias Dahl" <mathias.dahl@gmail.com> writes:

Hi Mathias,

> Richard, can you comment on the GIF issue above? I am suspecting that
> the old patent on the LZW compression algorithm has something to do
> with it (http://www.gnu.org/philosophy/gif.html). Does it? When
> opening JPEG and PNG files from Dired, I automaticaly see the image,
> and this does not happen with GIF.

Here it works with GIFs the same as it does with any other format. Are
you sure you compiled your emacs with gif support? AFAIKS you need
giflib therefore [1].

Bye,
Tassilo
__________
[1] http://sourceforge.net/projects/libungif/
-- 
Windows: So easy to admin, even a worm can do it.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  7:51   ` David Kastrup
@ 2007-04-25 14:03     ` Mathias Dahl
  0 siblings, 0 replies; 16+ messages in thread
From: Mathias Dahl @ 2007-04-25 14:03 UTC (permalink / raw)
  To: David Kastrup; +Cc: rms, emacs-devel

> Possibly depends on the libraries your Emacs has been compiled with.
> What is the output of
> (image-type-available-p 'gif)
> ?

It returns `nil' while testing with 'jpeg and 'png returns `t', so
indeed this seems to be my problem. Thanks!

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  2:05 [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings] Richard Stallman
  2007-04-25  4:57 ` Glenn Morris
  2007-04-25  7:47 ` Mathias Dahl
@ 2007-04-26  2:56 ` Glenn Morris
  2007-04-26 11:31   ` Mathias Dahl
  2 siblings, 1 reply; 16+ messages in thread
From: Glenn Morris @ 2007-04-26  2:56 UTC (permalink / raw)
  To: rms, mathias.dahl, Stephen.Berman; +Cc: emacs-devel

Richard Stallman wrote:

> From: Mathias Dahl <mathias.dahl@gmail.com>
> Subject: Re: Tumme fails with default custom settings
> To: emacs-pretest-bug@gnu.org
> Date: Tue, 24 Apr 2007 20:18:10 +0200

[...]

> Anyway, this fixes the parent poster's problem but not the problem the
> original poster had (that I was not able to reproduce, yet).

Reading Stephen's original report, it sounds an awful lot like his
problem was caused by +profile "*" expanding the "*" to a list of file
names, but how this could happen I have no idea (some obscure shell?).

Can you replace +profile "*" with -strip, or do you need the comments
in thumbnails?

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-25  7:47 ` Mathias Dahl
  2007-04-25  7:51   ` David Kastrup
  2007-04-25 10:10   ` Tassilo Horn
@ 2007-04-26  4:23   ` Richard Stallman
  2 siblings, 0 replies; 16+ messages in thread
From: Richard Stallman @ 2007-04-26  4:23 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: emacs-devel

The patents on static GIFs have expired, so there is no legal reason
not to include support for them.  In any case, _display_ of GIFs was
never a problem.  Only generation was a problem.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-26  2:56 ` Glenn Morris
@ 2007-04-26 11:31   ` Mathias Dahl
  2007-04-26 15:24     ` Glenn Morris
  0 siblings, 1 reply; 16+ messages in thread
From: Mathias Dahl @ 2007-04-26 11:31 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stephen.Berman, rms, emacs-devel

> Reading Stephen's original report, it sounds an awful lot like his
> problem was caused by +profile "*" expanding the "*" to a list of file
> names, but how this could happen I have no idea (some obscure shell?).

That might explain why I could not recreate it, yes.

> Can you replace +profile "*" with -strip, or do you need the comments
> in thumbnails?

I have no preference really. I guess I kind of "inherited" that
+profile command line switch from some example I found on the net.
When I read about -profile and +profile last week however, I thought
the same thing as you, why not replace it with -strip? But I also
thought, why change something that works? (although in this case it
does not work for everyone...).

I am curious though, from the following text, where does it say that
comments will not be removed if we use -strip?

===
-profile filename

add ICM, IPTC, or generic profile to image.

-profile filename adds an ICM (ICC color management), IPTC (newswire
information), or a generic profile to the image

Use +profile icm, +profile iptc, or +profile profile_name to remove
the respective profile. Use identify -verbose to find out what
profiles are in the image file. Use -strip to remove all profiles.
===

To me it sounds like +profile "*" and -strip would do the same job.

BTW, would using single quotes (') around the asterisk maybe work better?

/Mathias

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-26 11:31   ` Mathias Dahl
@ 2007-04-26 15:24     ` Glenn Morris
  2007-04-26 20:11       ` Mathias Dahl
  2007-04-26 21:00       ` Stephen Berman
  0 siblings, 2 replies; 16+ messages in thread
From: Glenn Morris @ 2007-04-26 15:24 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: Stephen.Berman, rms, emacs-devel

"Mathias Dahl" wrote:

> I am curious though, from the following text, where does it say that
> comments will not be removed if we use -strip?

I guess you meant "will be removed". It doesn't say it there, but in
the man page I have for convert, or in the output of --help, it says:

   -strip               strip image of all profiles and comments

This is

Version: ImageMagick 6.0.7 02/15/07 Q16 http://www.imagemagick.org

on rhel 4.4.

> BTW, would using single quotes (') around the asterisk maybe work better?

Possibly, though I don't see why. Stephen, what is your shell, and
what happens if you do the following in a directory with files:

echo "*"
echo '*'

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-26 15:24     ` Glenn Morris
@ 2007-04-26 20:11       ` Mathias Dahl
  2007-04-26 21:00       ` Stephen Berman
  1 sibling, 0 replies; 16+ messages in thread
From: Mathias Dahl @ 2007-04-26 20:11 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stephen.Berman, rms, emacs-devel

> > I am curious though, from the following text, where does it say that
> > comments will not be removed if we use -strip?
>
> I guess you meant "will be removed".

Yes, my bad.

> It doesn't say it there, but in
> the man page I have for convert, or in the output of --help, it says:
>
>    -strip               strip image of all profiles and comments

Ah! Well, I guess that would be even better since the point is to make
the thumbnail images as small as possible.

I'll wait and see what Stephen says.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-26 15:24     ` Glenn Morris
  2007-04-26 20:11       ` Mathias Dahl
@ 2007-04-26 21:00       ` Stephen Berman
  2007-04-27  0:58         ` Glenn Morris
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Berman @ 2007-04-26 21:00 UTC (permalink / raw)
  To: emacs-devel

On Thu, 26 Apr 2007 11:24:07 -0400 Glenn Morris <rgm@gnu.org> wrote:

> "Mathias Dahl" wrote:
>
>> I am curious though, from the following text, where does it say that
>> comments will not be removed if we use -strip?
>
> I guess you meant "will be removed". It doesn't say it there, but in
> the man page I have for convert, or in the output of --help, it says:
>
>    -strip               strip image of all profiles and comments
>
> This is
>
> Version: ImageMagick 6.0.7 02/15/07 Q16 http://www.imagemagick.org
>
> on rhel 4.4.
>
>> BTW, would using single quotes (') around the asterisk maybe work better?
>
> Possibly, though I don't see why. Stephen, what is your shell, and
> what happens if you do the following in a directory with files:
>
> echo "*"
> echo '*'

M-x getenv RET SHELL RET
    => /bin/bash

$ cd /tmp
$ ls | wc -l
158
$ echo "*"
*
$ echo '*'
*

bash --version
GNU bash, version 3.1.17(1)-release (i586-suse-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
ppwd 0
dirs +0

It didn't help to use +profile '*'; however, using -strip in its place
makes tumme work fine for me (just like having neither -strip nor
+profile).

Steve Berman

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-26 21:00       ` Stephen Berman
@ 2007-04-27  0:58         ` Glenn Morris
  2007-04-27 20:39           ` Richard Stallman
  0 siblings, 1 reply; 16+ messages in thread
From: Glenn Morris @ 2007-04-27  0:58 UTC (permalink / raw)
  To: Stephen Berman, Mathias Dahl; +Cc: emacs-devel

Stephen Berman wrote:

> It didn't help to use +profile '*'; however, using -strip in its place
> makes tumme work fine for me (just like having neither -strip nor
> +profile).

Well I have no idea what is going on with convert on your system; but
I suggest we just switch to -strip, delete this item from FOR-RELEASE,
and move on.

Seems strip is supported even on old imagemagicks, but even it it were
not, the error message would most likely be more straightforward than
the ones you were getting.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-27  0:58         ` Glenn Morris
@ 2007-04-27 20:39           ` Richard Stallman
  2007-04-28  4:11             ` Glenn Morris
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Stallman @ 2007-04-27 20:39 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stephen.Berman, emacs-devel, mathias.dahl

    Well I have no idea what is going on with convert on your system; but
    I suggest we just switch to -strip, delete this item from FOR-RELEASE,
    and move on.

Ok, please do that.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-27 20:39           ` Richard Stallman
@ 2007-04-28  4:11             ` Glenn Morris
  2007-04-28 12:46               ` Mathias Dahl
  0 siblings, 1 reply; 16+ messages in thread
From: Glenn Morris @ 2007-04-28  4:11 UTC (permalink / raw)
  To: rms; +Cc: Stephen.Berman, emacs-devel, mathias.dahl

Richard Stallman wrote:

>     I suggest we just switch to -strip, delete this item from FOR-RELEASE,
>     and move on.
>
> Ok, please do that.

installed on trunk and branch.

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

* Re: [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings]
  2007-04-28  4:11             ` Glenn Morris
@ 2007-04-28 12:46               ` Mathias Dahl
  0 siblings, 0 replies; 16+ messages in thread
From: Mathias Dahl @ 2007-04-28 12:46 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stephen.Berman, rms, emacs-devel

> >     I suggest we just switch to -strip, delete this item from FOR-RELEASE,
> >     and move on.
> >
> > Ok, please do that.
>
> installed on trunk and branch.

I just compiled a new CVS Emacs here and it seems to work fine with
the -strip option.

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

end of thread, other threads:[~2007-04-28 12:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-25  2:05 [mathias.dahl@gmail.com: Re: Tumme fails with default custom settings] Richard Stallman
2007-04-25  4:57 ` Glenn Morris
2007-04-25  7:47 ` Mathias Dahl
2007-04-25  7:51   ` David Kastrup
2007-04-25 14:03     ` Mathias Dahl
2007-04-25 10:10   ` Tassilo Horn
2007-04-26  4:23   ` Richard Stallman
2007-04-26  2:56 ` Glenn Morris
2007-04-26 11:31   ` Mathias Dahl
2007-04-26 15:24     ` Glenn Morris
2007-04-26 20:11       ` Mathias Dahl
2007-04-26 21:00       ` Stephen Berman
2007-04-27  0:58         ` Glenn Morris
2007-04-27 20:39           ` Richard Stallman
2007-04-28  4:11             ` Glenn Morris
2007-04-28 12:46               ` Mathias Dahl

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