* image descriptors and defimage with :data
@ 2002-02-08 3:50 Nic Ferrier
2002-02-08 20:26 ` Pavel Janík
2002-02-10 5:18 ` Richard Stallman
0 siblings, 2 replies; 5+ messages in thread
From: Nic Ferrier @ 2002-02-08 3:50 UTC (permalink / raw)
I'm building an image from a part returned by an IMAP server.
Instead of saving the part to a file and opening it that way I
thought it would be fun to have no file caching and just open the
image directly from the imap server.
My code gets the part from the imap server as a string and then
constructs an image descriptor for it.
It then uses insert-image to get it into a buffer.
But the image doesn't get displayed.
Emacs 21 manual says that defimage must have at least the following
properties in the props list:
:type
:file
But I don't want to specify the image as a file. Can (defimage ...)
cope with something like the following?
(defimage content-image
((:type jpeg :data content)))
Nic Ferrier
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: image descriptors and defimage with :data
2002-02-08 3:50 image descriptors and defimage with :data Nic Ferrier
@ 2002-02-08 20:26 ` Pavel Janík
2002-02-10 5:18 ` Richard Stallman
1 sibling, 0 replies; 5+ messages in thread
From: Pavel Janík @ 2002-02-08 20:26 UTC (permalink / raw)
Cc: emacs-devel
From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
Date: 08 Feb 2002 03:50:53 +0000
> But I don't want to specify the image as a file. Can (defimage ...)
> cope with something like the following?
>
> (defimage content-image
> ((:type jpeg :data content)))
Of course. Can you please create a small sample so we can debug it? Try
to evaluate the following:
(progn
(defimage content-image ((:type xpm :data "/* XPM */
static char * letter_xpm[] = {
\"14 10 2 1\",
\". c \#000000\",
\" c \#FFFFFF\",
\"..............\",
\"... ...\",
\". . . .\",
\". . . .\",
\". .... .\",
\". . .. . .\",
\". . . .\",
\". . . .\",
\".. ..\",
\"..............\"};
")))
(insert-image content-image))
--
Pavel Janík
/* Identify the flock of penguins. */
-- 2.2.16 arch/alpha/kernel/setup.c
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: image descriptors and defimage with :data
2002-02-08 3:50 image descriptors and defimage with :data Nic Ferrier
2002-02-08 20:26 ` Pavel Janík
@ 2002-02-10 5:18 ` Richard Stallman
2002-02-10 13:53 ` Nic Ferrier
1 sibling, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2002-02-10 5:18 UTC (permalink / raw)
Cc: emacs-devel
Emacs 21 manual says that defimage must have at least the following
properties in the props list:
Where does it say that? Here is the text I see:
Each argument in @var{specs} has the form of a property list, and each
one should specify at least the @code{:type} property and either the
@code{:file} or the @code{:data} property. The value of @code{:type}
should be a symbol specifying the image type, the value of
@code{:file} is the file to load the image from, and the value of
@code{:data} is a string containing the actual image data. Here is an
example:
However, judging from the previous node in the manual, I think that
:data is not supported yet for image type JPEG. If so, we would like
to support it; would you like to try to implement it?
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: image descriptors and defimage with :data
2002-02-10 5:18 ` Richard Stallman
@ 2002-02-10 13:53 ` Nic Ferrier
2002-02-11 18:47 ` Richard Stallman
0 siblings, 1 reply; 5+ messages in thread
From: Nic Ferrier @ 2002-02-10 13:53 UTC (permalink / raw)
Cc: emacs-devel
Nic said:
Emacs 21 manual says that defimage must have at least the following
properties in the props list:
rms replied:
> Where does it say that? Here is the text I see:
>
> Each argument in @var{specs} has the form of a property list, and each
> one should specify at least the @code{:type} property and either the
> @code{:file} or the @code{:data} property. The value of @code{:type}
> should be a symbol specifying the image type, the value of
> @code{:file} is the file to load the image from, and the value of
> @code{:data} is a string containing the actual image data. Here is an
> example:
>
> However, judging from the previous node in the manual, I think that
> :data is not supported yet for image type JPEG. If so, we would like
> to support it; would you like to try to implement it?
The function documentation string for defimage says this:
Each image specification in SPECS is a property list. The contents of
a specification are image type dependent. All specifications must at
least contain the properties `:type TYPE' and either `:file FILE' or
`:data DATA', where TYPE is a symbol specifying the image type,
e.g. `xbm', FILE is the file to load the image from, and DATA is a
string containing the actual image data. The first image
specification whose TYPE is supported, and FILE exists, is used to
define SYMBOL.
I am trying to narrow the problem down so that I can either patch it
or give a better report.
Nic
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: image descriptors and defimage with :data
2002-02-10 13:53 ` Nic Ferrier
@ 2002-02-11 18:47 ` Richard Stallman
0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-02-11 18:47 UTC (permalink / raw)
Cc: emacs-devel
Use of :data is implemented only for some image types.
I suggest you check the specific code that handles JPEG type
and see if it implements :data.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-02-11 18:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-08 3:50 image descriptors and defimage with :data Nic Ferrier
2002-02-08 20:26 ` Pavel Janík
2002-02-10 5:18 ` Richard Stallman
2002-02-10 13:53 ` Nic Ferrier
2002-02-11 18:47 ` Richard Stallman
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).