diff scripts/image/imformats.m @ 17351:80bf005cdf8e

New function __magick_ping__ to speed reading of images. * __magick_read__.cc (__magick_ping__): New function that only pings one of the images in a file to obtain height, width and format information. This becomes an alternative to imfinfo for internal Octave functions. Because imfinfo requires reading of the whole file and all images, this has a large speed increase, specially for multipage images. * imformats.m: use __magick_ping__() to check image format. * private/__imread__.m: use __magick_ping__() to get rows and columns of an image which is used to set the reading defaults.
author Carnë Draug <carandraug@octave.org>
date Fri, 30 Aug 2013 07:19:13 +0100
parents 1c89599167a6
children 6dbc866379e2
line wrap: on
line diff
--- a/scripts/image/imformats.m	Thu Aug 29 06:31:55 2013 +0100
+++ b/scripts/image/imformats.m	Fri Aug 30 07:19:13 2013 +0100
@@ -277,7 +277,7 @@
 function bool = isa_magick (coder, filename)
   bool = false;
   try
-    info = __imfinfo__ (filename);
+    info = __magick_ping__ (filename, 1);
     bool = strcmp (coder, info.Format);
   end_try_catch
 endfunction