octave-maintainers
[Top][All Lists]
Advanced

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

Re: imread


From: Søren Hauberg
Subject: Re: imread
Date: Wed, 02 Jul 2008 20:26:24 +0200

tir, 01 07 2008 kl. 17:00 -0400, skrev Thomas Scofield:
> I'm attaching the changed code as .m (imread.m) and .cc (__magick_read__.cc)
> files, which I hope is workable.  The way I compile __magick_read__.cc is
> with the command
> 
>    mkoctfile __magick_read__.cc `GraphicsMagick++-config --cppflags` 
> -lGraphicsMagick++ -lGraphicsMagick
> 
> which presumes you have the GraphicsMagick libraries in the right places
> which, for me, was as specified in the note I sent earlier today starting
> this thread.  GraphicsMagick++-config is a script whose purpose I don't
> quite understand (it may not be necessary).  On my debian-based machine
> it came with GraphicsMagick, and parallels the script Magick++-config that
> came with one of the ImageMagick packages.  I include the script in the
> mkoctfile command above because in the Makefile for the image-1.0.6 package
> the ImageMagick version of the script appears in the same position.

I've only played with this for a couple of seconds for Octave 3.0.0, so
this'll be brief. I've tried

  I = imread ("some_pic.something");
  imshow (I)

and the result looks wrong with all the images I've tried. This might be
a bug in 'imshow', but I haven't had the time to investigate.

As to the code, I have a few comments:

  1) When I compile with '-Wall' I get a warning at line 94. Changing
line 22 from 'int i = mapsize;' to 'unsigned int i = mapsize;', fixes
this.

  2) The code formatting doesn't seem to match Octaves. Instead of
writing

for (...) {
    ...
}

please write

for (...)
  {
    ...
  }

and same for if statements, while loops, etc. If the loop body only
contains one line, then omit the curly brackets.

Instead of writing

for(...)

please write

for (...)

notice the extra space before the parenthesis. Same goes for if
statements, function calls, etc.

I'll report back when I know if my problems are related to 'imread' or
'imshow'.

Søren



reply via email to

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