octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: merging imread and imwrite


From: Søren Hauberg
Subject: Re: merging imread and imwrite
Date: Tue, 29 Jan 2008 09:30:26 +0100

man, 28 01 2008 kl. 17:56 -0500, skrev John W. Eaton:
> I'd like to get imread and imwrite functions in Octave.  I see that
> there are functions in Octave Forge, but they will need some work.
> 
> The core of imread is
> 
>     ## divert jpegs and pngs to "jpgread" and "pngread"
>     if ( file_in_loadpath("jpgread.oct") &&
>       (strcmp(ext, ".JPG") || strcmp(ext, ".JPEG")) )
>       varargout{1} = jpgread(fn);
>       break
>     endif
>     if ( file_in_loadpath("pngread.oct") && (strcmp(ext, ".PNG")) )
>       varargout{1} = pngread(fn);
>       break
>     endif
>     
>     ## alternately, use imagemagick
>     if ( file_in_loadpath("__magick_read__.oct") )
>       [varargout{1:nargout}] = __magick_read__(fn, varargin{:});
>       break
>     endif
> 
> Why not use ImageMagick to do all the work instead of special-casing
> jpg and png files?
I guess if the user doesn't link against libmagick, but do link against
libpng then the above makes sense.

> Also, is there some other graphics library that we could wrap to
> handle reading and writing image files that might be better, or is
> ImageMagick a good choice?
I don't know if ImageMagick still insists on breaking their API on a
regular basis, but some time ago they did. If this is an issue then
GraphicsMagick might be a better choice (it's a fork of ImageMagick that
attempts to keep their API stable).

Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]