# HG changeset patch # User sjvdw # Date 1141044400 0 # Node ID 555d933113b6db5a94d2874edc00a9c1ad5c3c8a # Parent 36e459515715c1b975cbe5c6519e4f1f4776c6d8 Imagemagick interface is broken for PNGs. Use pngread and jpgread in the meantime. diff --git a/imread.m b/imread.m --- a/imread.m +++ b/imread.m @@ -45,11 +45,8 @@ [ig, ig, ext] = fileparts(fn); - ext = upper(ext); - if ( file_in_loadpath("__magick_read__.oct") ) - varargout{:} = __magick_read__(fn, varargin{:}); - break - endif + ext = upper(ext); + ## divert jpegs and pngs to "jpgread" and "pngread" if ( file_in_loadpath("jpgread.oct") && (strcmp(ext, ".JPG") || strcmp(ext, ".JPEG")) ) @@ -59,8 +56,14 @@ if ( file_in_loadpath("pngread.oct") && (strcmp(ext, ".PNG")) ) varargout{1} = pngread(fn); break - endif - + endif + + ## alternately, use imagemagick + if ( file_in_loadpath("__magick_read__.oct") ) + varargout{:} = __magick_read__(fn, varargin{:}); + break + endif + [ident, sys] = system(sprintf('identify -verbose %s | grep -e "Red: " -e Type', fn)); if (sys != 0)