aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/display.texi31
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/image.el10
5 files changed, 36 insertions, 19 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 78bc55af941..f5b2425581b 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
12014-01-22 Glenn Morris <rgm@gnu.org>
2
3 * display.texi (ImageMagick Images): Expand on image-format-suffixes.
4
12014-01-20 Glenn Morris <rgm@gnu.org> 52014-01-20 Glenn Morris <rgm@gnu.org>
2 6
3 * hash.texi (Other Hash): Do not mention subr-x.el functions; 7 * hash.texi (Other Hash): Do not mention subr-x.el functions;
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index f42d02e056f..9123e940e08 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4690,6 +4690,16 @@ should never be rendered using ImageMagick, regardless of the value of
4690ImageMagick entirely. 4690ImageMagick entirely.
4691@end defopt 4691@end defopt
4692 4692
4693@defvar image-format-suffixes
4694This variable is an alist mapping image types to file name extensions.
4695Emacs uses this in conjunction with the @code{:format} image property
4696(see below) to give a hint to the ImageMagick library as to the type
4697of an image. Each element has the form @code{(@var{type}
4698@var{extension})}, where @var{type} is a symbol specifying an image
4699content-type, and @var{extension} is a string that specifies the
4700associated file name extension.
4701@end defvar
4702
4693 Images loaded with ImageMagick support the following additional 4703 Images loaded with ImageMagick support the following additional
4694image descriptor properties: 4704image descriptor properties:
4695 4705
@@ -4700,13 +4710,13 @@ color, which is used as the image's background color if the image
4700supports transparency. If the value is @code{nil}, it defaults to the 4710supports transparency. If the value is @code{nil}, it defaults to the
4701frame's background color. 4711frame's background color.
4702 4712
4703@item :width, :height 4713@item :width @var{width}, :height @var{height}
4704The @code{:width} and @code{:height} keywords are used for scaling the 4714The @code{:width} and @code{:height} keywords are used for scaling the
4705image. If only one of them is specified, the other one will be 4715image. If only one of them is specified, the other one will be
4706calculated so as to preserve the aspect ratio. If both are specified, 4716calculated so as to preserve the aspect ratio. If both are specified,
4707aspect ratio may not be preserved. 4717aspect ratio may not be preserved.
4708 4718
4709@item :max-width, :max-height 4719@item :max-width @var{max-width}, :max-height @var{max-height}
4710The @code{:max-width} and @code{:max-height} keywords are used for 4720The @code{:max-width} and @code{:max-height} keywords are used for
4711scaling if the size of the image of the image exceeds these values. 4721scaling if the size of the image of the image exceeds these values.
4712If @code{:width} is set it will have precedence over @code{max-width}, 4722If @code{:width} is set it will have precedence over @code{max-width},
@@ -4715,19 +4725,16 @@ and if @code{:height} is set it will have precedence over
4715wish. @code{:max-width} and @code{:max-height} will always preserve 4725wish. @code{:max-width} and @code{:max-height} will always preserve
4716the aspect ratio. 4726the aspect ratio.
4717 4727
4718@c FIXME: ':format-type' or ':format'? --xfq 4728@item :format @var{type}
4719@item :format 4729The value, @var{type}, should be a symbol specifying the type of the
4720ImageMagick tries to auto-detect the image type, but it isn't always 4730image data, as found in @code{image-format-suffixes}. This is used
4721able to. By using @code{:format-type}, we can give ImageMagick a hint 4731when the image does not have an associated file name, to provide a
4722to try to help it. It's used in conjunction with the 4732hint to ImageMagick to help it detect the image type.
4723@code{image-format-suffixes} variable, which provides a mapping from
4724content types to file name suffixes. This is then given to
4725ImageMagick as a file name hint.
4726 4733
4727@item :rotation 4734@item :rotation @var{angle}
4728Specifies a rotation angle in degrees. 4735Specifies a rotation angle in degrees.
4729 4736
4730@item :index 4737@item :index @var{frame}
4731@c Doesn't work: http://debbugs.gnu.org/7978 4738@c Doesn't work: http://debbugs.gnu.org/7978
4732@xref{Multi-Frame Images}. 4739@xref{Multi-Frame Images}.
4733@end table 4740@end table
diff --git a/etc/NEWS b/etc/NEWS
index 7f8907d3b1e..f656fb96431 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -175,9 +175,11 @@ Use `C-h C-\' (`describe-input-method') instead.
175+++ 175+++
176*** ImageMagick images now support the :max-width and :max-height keywords. 176*** ImageMagick images now support the :max-width and :max-height keywords.
177 177
178*** Some data types aren't auto-detected by ImageMagick. 178+++
179Adding :format to `create-image' may help if the content type is in 179*** When using `create-image' with image data, you can pass a :format
180the new variable `image-format-suffixes'. 180attribute (via the property-list argument) in order to help
181ImageMagick detect the image type. The value should be a MIME
182content-type that is found in the new variable `image-format-suffixes'.
181 183
182** Frame and window changes 184** Frame and window changes
183 185
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 106e12e88b7..974cd2223ef 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12014-01-22 Glenn Morris <rgm@gnu.org> 12014-01-22 Glenn Morris <rgm@gnu.org>
2 2
3 * image.el (image-format-suffixes): Doc fix.
4
3 * international/quail.el (quail-define-package): Doc fix. 5 * international/quail.el (quail-define-package): Doc fix.
4 6
5 * emacs-lisp/authors.el (authors-valid-file-names): 7 * emacs-lisp/authors.el (authors-valid-file-names):
diff --git a/lisp/image.el b/lisp/image.el
index dec6991666a..d16fe4fb0ba 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -104,11 +104,13 @@ AUTODETECT can be
104 104
105(defvar image-format-suffixes 105(defvar image-format-suffixes
106 '((image/x-icon "ico")) 106 '((image/x-icon "ico"))
107 "Alist of MIME Content-Type headers to file name suffixes. 107 "An alist associating image types with file name suffixes.
108This is used as a hint by the ImageMagick library when detecting 108This is used as a hint by the ImageMagick library when detecting
109image types. If `create-image' is called with a :format 109the type of image data (that does not have an associated file name).
110matching found in this alist, the ImageMagick library will be 110Each element has the form (MIME-CONTENT-TYPE EXTENSION).
111told that the data would have this suffix if saved to a file.") 111If `create-image' is called with a :format attribute whose value
112equals a content-type found in this list, the ImageMagick library is
113told that the data would have the associated suffix if saved to a file.")
112 114
113(defcustom image-load-path 115(defcustom image-load-path
114 (list (file-name-as-directory (expand-file-name "images" data-directory)) 116 (list (file-name-as-directory (expand-file-name "images" data-directory))