octave-maintainers
[Top][All Lists]
Advanced

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

Re: imread.m


From: David Bateman
Subject: Re: imread.m
Date: Thu, 17 Jul 2008 11:46:08 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080306)

John W. Eaton wrote:
> On 16-Jul-2008, John W. Eaton wrote:
> 
> | The following patch seems to fix the problem for me, and also improves
> | compatibility with regard to the way cdata is stored and clim is
> | computed.  But maybe I messed up something else with this change, so
> | it would help if people who work with images could do some testing.
> 
> I've also now checked in some changes to imread so that it will first
> try __magick_read__, then attempt to read Octave's image format (the
> file format that was originally handled by loadimage).  The loadimage
> function is now deprecated.
> 
> These changes seem to work for me but could probably use some
> additional testing.
> 
> Thanks,
> 
> jwe
> 


Could the attached changeset also be committed as currently Octaev can't
be built if GraphicsMagick is not installed.

D.

# HG changeset patch
# User David Bateman <address@hidden>
# Date 1216287806 -7200
# Node ID c3608df3b40cc1e218daccf9057d743cc0144ae2
# Parent  1eedd77a192ee39d5b1813e589efeb521df852d0
Allow build without GraphicsMagick installed

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 2008-07-16  Michael Goffioul  <michael.g
+2008-07-17  David Bateman  <address@hidden>
+
+       * configure.in (HAVE_MAGICK): New define for presence of
+       GraphicsMagick.
+
 2008-07-16  Michael Goffioul  <address@hidden>
 
        * configure.in: Add check for pthread.h.
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -641,6 +641,8 @@ AC_CHECK_PROGS(MAGICK_CONFIG, [GraphicsM
 AC_CHECK_PROGS(MAGICK_CONFIG, [GraphicsMagick++-config GraphicsMagick-config])
 if test -z "$MAGICK_CONFIG"; then
   warn_magick="GraphicsMagick++ config script not found.  Assuming 
GraphicsMagic++ library and header files are missing, so imread will not be 
fully functional"
+else
+  AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.])
 fi
 
 # ---------------------------------------------------------------------
diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@ 2008-07-15  John W. Eaton  <address@hidden
+2008-07-17  David Bateman  <address@hidden>
+
+       * DLD-FUNCTION/__magick_read__.cc (F__magick_read__): Allow build
+       without GraphicsMagick++ installed.
+
 2008-07-15  John W. Eaton  <address@hidden>
 
        * DLD-FUNCTIONS/__convn__.cc (convn): Cast second arg to
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
@@ -27,6 +27,8 @@ along with Octave; see the file COPYING.
 
 #include "defun-dld.h"
 #include "error.h"
+
+#ifdef HAVE_MAGICK
 
 #include <GraphicsMagick/Magick++.h>
 
@@ -303,6 +305,7 @@ read_images (const std::vector<Magick::I
 
   return retval;
 }
+#endif // HAVE_MAGICK
 
 DEFUN_DLD (__magick_read__, args, nargout,
   "-*- texinfo -*-\n\
@@ -316,6 +319,7 @@ Instead you should use @code{imread}.\n\
 {
   octave_value_list output;
 
+#ifdef HAVE_MAGICK
   if (args.length () > 2 || args.length () < 1 || ! args(0).is_string ()
       || nargout > 3)
     {
@@ -401,6 +405,11 @@ Instead you should use @code{imread}.\n\
          error ("__magick_read__: image depths bigger than 16-bit not 
supported");
        }
     }
+#else
+
+  error ("__magick_read__: not available in this version of Octave");
+
+#endif
 
   return output;
 }

reply via email to

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