# HG changeset patch # User John Swensen # Date 1284620195 14400 # Node ID 165e7e79b82c8eb0e20b1b92b9a27d2f625618b6 # Parent 58c57161626df75d0da1cc9bfb90495a108fa90c Updated for writing image files via imwrite. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-09-16 John Swensen + + * imwrite.m: Accept more image formats. + 2010-09-16 Jaroslav Hajek * signal/periodogram.m: Support additional inputs: diff --git a/scripts/image/imwrite.m b/scripts/image/imwrite.m --- a/scripts/image/imwrite.m +++ b/scripts/image/imwrite.m @@ -36,13 +36,39 @@ ## quality and lower compression. ## @end table ## +## @strong{Supported Formats} +## @multitable @columnfractions .33 .66 +## @headitem Extension @tab Format +## @item bmp @tab Windows Bitmap +## @item gif @tab Graphics Interchange Format +## @item jpg and jpeg @tab Joint Photographic Experts Group +## @item pbm @tab Portable Bitmap +## @item pcx @tab +## @item pgm @tab Portable Graymap +## @item png @tab Portable Network Graphics +## @item pnm @tab Portable Anymap +## @item ppm @tab Portable Pixmap +## @item ras @tab Sun Raster +## @item tif and tiff @tab Tagged Image File Format +## @item xwd @tab X11 Dump +## @end multitable +## +## @strong{Unsupported Formats} +## @multitable @columnfractions .33 .66 +## @headitem Extension @tab Format +## @item hdf @tab Hierarchical Data Format V4 +## @item jp2 and jpx @tab Joint Photographic Experts Group 2000 +## @end multitable +## ## @seealso{imread, imfinfo} ## @end deftypefn function imwrite (img, varargin) - + + %missing_formats = { "hdf", "jp2", "jpx" }; persistent accepted_formats = { "bmp", "gif", "jpg", "jpeg", ... - "ras", "pbm", "pgm", "png", "ppm", "svg", "tif", "tiff" }; + "pbm", "pcx", "pgm", "png", "pnm", "ppm", "ras", ... + "tif", "tiff", "xwd" }; if (nargin < 2 || ! (isnumeric (img) || islogical (img))) print_usage (); diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,11 +1,16 @@ +2010-09-16 John Swensen + + * DLD-FUNCTIONS/__magick_read__.cc (write_images): Allow + arbitrary extensions with format specifier. + 2010-09-15 John W. Eaton * load-path.cc (Faddpath, Frmpath): Document path arguments. 2010-09-15 John Swensen - * __magick_read__.cc: Allow image_write to write filetypes - without an extension (bug #30784). + * DLD-FUNCTIONS/__magick_read__.cc (write_image): Allow writing + arbitrary image types to filenames without an extension (bug #30784). 2010-09-14 John W. Eaton diff --git a/src/DLD-FUNCTIONS/__magick_read__.cc b/src/DLD-FUNCTIONS/__magick_read__.cc --- a/src/DLD-FUNCTIONS/__magick_read__.cc +++ b/src/DLD-FUNCTIONS/__magick_read__.cc @@ -837,7 +837,7 @@ for (size_t i = 0; i < imvec.size (); i++) imvec[i].magick (fmt); - Magick::writeImages (imvec.begin (), imvec.end (), filename); + Magick::writeImages (imvec.begin (), imvec.end (), fmt + ":" + filename); } catch (Magick::Warning& w) {