doc improvement
[emacs.git] / README.imagemagick
bloba4910d212ee81c10267990a3acb88db369870f8c
1 This is the imagemagick branch of Emacs. Imagemagick can now be used
2 to load many new image formats, and also do useful transforms like
3 scaling and rotation.
5 This file will attempt to contain draft NEWS, Changelog and manual
6 entries for the new functionality. 
8 You might need to regenerate the configure scripts:
9 aclocal
10 automake
11 autoheader
12 autoconf
13 ./configure --with-imagemagick
17 * TODO
18 #B _ complete documentation drafts below
20 #B X fix inconsistencys with spelling of imagemagick in the src
21 #B X report number of images in image bundle types somehow
22 Works like for "gif" support. Thanks to Juri Linkov.
23 #B X probably add pdf to inhibited types
24 #B X inhibit types is defconst should probably be defcustom
25 #B _ decide what to do with some uncommitted imagemagick support
26   functions for image size etc.
27 #B _ Test with more systems
28 Tested on Fedora 12 so far, and the libmagick that ships with it.
29 Ubuntu 8.04 was also tested, but it seems it ships a broken ImageMagick.
30 #B X Also need some way to handle render methods that only work on newer ImageMagicks
31 Is handled by configure now
33 * Some nits from Stefan Monnier
34 I just took a quick look at the code and I see the following nits to fix:
35 #B _ obviously a merge will have to come with a good ChangeLog.
36 #B X also the merge will need to come with documentation.  Maybe not in the
37    Texinfo form yet, but at least in the etc/NEWS with enough info that
38    describes the `scale' and other such arguments that someone can start
39    using them.
40 #B X the README talks about naming inconsistencies, I think these should be
41   fixed before a first commit (should be straightforward).
43 #B X the "let" in image.el should not be followed by a line break and the while
44    should be replaced by a dolist.
46 #B X the prototype of imagemagick_load_image has some odd indentation in ([[2010.06.14]])
47    its args, not sure what happened.
48 #B X a few lines in the C code break the 80columns limit.
49 #B X please use ANSI style function declarations rather than K&R for new code. ([[2010.06.14]])
50 #B X you can get rid of the prototypes by reordering the code. ([[2010.06.14]])
51 #B X the docstrings in DEFUN should not be indented (they'll display ([[2010.06.14]])
52    weirdly otherwise in C-h f).
53 #B X Some "{" are at the end of a for/if rather than on their own line. ([[2010.06.14]])
54 #B X why use "*( imtypes + i)" rather than "imtypes[i]"? ([[2010.06.14]])
55 #B X some "," lack a space after them. ([[2010.06.14]])
56 #B X several "=" and "==" lack spaces around them. ([[2010.06.14]])
59 * NEWS entry
60 ** ImageMagick support
61 It is now possible to use the Imagemagick library to load many new
62 image formats in Emacs.
64 To enable, use the following configure option:
65 --with-imagemagick
67 The new function (imagemagick-types) returns a list of image file
68 extensions that your installation of imagemagick supports.
70 The function (imagemagick-register-types) will enable the imagemagick
71 support for the extensions in imagemagick-types minus the types listed
72 in imagemagick-types-inhibit.
74 imagemagick-types-inhibit has the value  '(C HTML HTM TXT PDF) by default.
75 This means imagemagick will be used also to load jpeg files, if you
76 have both jpeg and imagemagick libraries linked. Add 'JPG to
77 imagemagick-types-inhibit if you do not want this.
79 Images loaded with imagemagick will support a couple of new display
80 specifications:
82 - :geometry takes a geometry string as defined by ImageMagick:
84 scale%            
85 scale-x%xscale-y% 
86 width             
87 xheight           
88 widthxheight      
89 widthxheight^     
90 widthxheight!     
91 widthxheight>     
92 widthxheight<     
93 area@             
94 {size}{offset}
95 {size}{+-}x{+-}y
97 See the ImageMagick manual for more information.
99 Furthermore, if the :width and :height keywords are specified, these
100 values are used for scaling the image.
102 - :rotation specifies a rotation angle in degrees.
104 - :index specifies which image inside an image bundle file format, such
105 as TIFF or DJVM, to view.
107 The image-metadata function can be used to retrieve the total number
108 of images in an image bundle. This is simmilar to how GIF files work.
110 - :crop is used to specify a croping area, with the {size}{offset}
111 syntax.  This is similar to the slice image specification, but has a
112 different purpose. :crop removes the croped areas from memory, so its
113 memory efficient if you only need to view a certain part of the
114 image. :slice can be used to pick diferent parts of the same image, so
115 its more disk and display efficient.
118 * Changelog entry
119 2010-06-12 Joakim Verona <joakim@verona.se>
120            * image.c: Add support for ImageMagick. When HAVE_IMAGEMAGICK is
121            defined:
122            (imagemagick_image_p): New function to test for ImageMagic img.
123            (imagemagick_load): New function to load ImageMagick img.
124            (imagemagick_load_image): New function, helper for imagemagick_load
125            (imagemagick-types): New function.
126            (Qimagemagick): New Lisp_object.
127            * image.el:
128            (imagemagick-types-inhibit): New var.
129            (imagemagick-register-types): New function.
130            * config.in, Makefile.in, configure.in
132 * Manual entry
133 nothing yet, but the NEWS entry could be adapted.