bugGNU Octave - Bugs: bug #45087, image package: rangefilt does...

 
 

bug #45087: image package: rangefilt does incorrect

Submitter:  Hartmut <hardy>
Submitted:  Tue 12 May 2015 08:29:01 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 02 Jun 2015 04:10:10 PM UTC, comment #7: 

Retagging release from 4.0.0-rc4 to 4.0.0.

John W. Eaton <jwe>
Group administrator
Sun 24 May 2015 04:20:46 PM UTC, comment #6: 

Thank you, I had fixed it with

  http://hg.code.sf.net/p/octave/image/rev/b348244c0153

I have now pushed your suggested test

  http://hg.code.sf.net/p/octave/image/rev/3a088259e167

Carnë Draug <carandraug>
Group Member
Wed 13 May 2015 09:59:46 AM UTC, comment #5: 

The same problem is in stdfilt.m, line 55.

The same test works here.


%!test
%! im = stdfilt (ones (5));
%! assert (im, zeros (5));


Avinoam Kalma <avinoam>
Group Member
Wed 13 May 2015 12:04:43 AM UTC, comment #4: 

Thank you for this. I have pushed it into the stable branch

http://hg.code.sf.net/p/octave/image/rev/953d8f19ca37

Unfortunately, I wouldn't be surprised if there weren't more locations like this (this is not the first time such bug creeps in), but specially old functions don't have tests.

Carnë Draug <carandraug>
Group Member
Tue 12 May 2015 09:07:23 PM UTC, comment #3: 

Sorry, I did not see the patch :-(


Avinoam Kalma <avinoam>
Group Member
Tue 12 May 2015 08:48:51 PM UTC, comment #2: 

Yes, this is half of the content if my attached patch :)

The interesting question is, if this bug maybe apears in multiple other m-files of the image package! I think this type of input check has been changed for Octave-4.0.0 compatibility. But because Octave 4.0.0 has not been released yet, there is hardly any testing done on image-2.4.0 so far.

Hartmut <hardy>
Tue 12 May 2015 08:45:31 PM UTC, comment #1: 

At the beginning of rangefilt.m


 if (! isnumeric (I) || ! islogical (I))
    error ("rangefilt: I must be a numeric or logical array");
  endif


It seems that it should be && and not ||, or


 if (!( isnumeric (I) ||  islogical (I)))


Avinoam Kalma <avinoam>
Group Member
Tue 12 May 2015 08:29:01 PM UTC, original submission:  

Here is a little script to show the behavior (image 2.4.0 under Octave 4.0.0-rc4):


pkg load image
I = ones(10);
J = rangefilt(I);


The result is an error message. I think this is only due  to incorrect input checks in rangefilt.m . I will attach a patch to correct this.

But it might be worth to check all other functions in the image package for this same type of bug!

Hartmut <hardy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #33990:  rangefilt_inputchecks.diff added by hardy (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by hardy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-02 jwe Release4.0.0-rc4 4.0.0
    2015-05-13 carandraug StatusNone Fixed
        Open/ClosedOpen Closed
    2015-05-12 hardy Attached File- Added rangefilt_inputchecks.diff, #33990

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code