bugGNU Octave - Bugs: bug #46259, image 2.4.1: fix to make montage()...

 
 

bug #46259: image 2.4.1: fix to make montage() DisplayRange" work

Submitted by:  None
Submitted on:  Tue 20 Oct 2015 10:08:24 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Michael Hirsch Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.0.0
Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 23 Oct 2015 08:43:44 PM UTC, comment #4: 

OK I like the looks of your revision even better, I didn't try it but looks great.

-*- <mhirsch>
Fri 23 Oct 2015 08:33:46 PM UTC, comment #3: 

I think the origin of the condition that led to this bug was that I didn't want to be defining the default display limits, I wanted to let imshow() do it.

But we can just use getrangefromclass() to set the default, which is what I did in http://hg.code.sf.net/p/octave/image/rev/1102459d894d

We were already using that for the limits of the Margin and Background color options.

Carnë Draug <carandraug>
Project Member
Thu 22 Oct 2015 11:25:40 PM UTC, comment #2: 

You're right, reversing the logic as in your comment #1 works fine. Let's apply your fix instead.

Thanks for your prompt attention.

-*- <mhirsch>
Wed 21 Oct 2015 11:28:52 AM UTC, comment #1: 

I don't understand what you mean. Could you give an example of the issue? What does this has to do with supporting old general inputParser? That should also had support for the UsingDefaults property.

It does seems to be a bug here, but I think it's just the logic that is reversed, i.e., instead of:

  if (any (strcmpi (p.UsingDefaults, "DisplayRange")))
    tmp_h = imshow (disp_img, p.Results.DisplayRange);
  else
    tmp_h = imshow (disp_img);
  endif

it should be:

  if (any (strcmpi (p.UsingDefaults, "DisplayRange")))
    tmp_h = imshow (disp_img);
  else
    tmp_h = imshow (disp_img, p.Results.DisplayRange);
  endif

Carnë Draug <carandraug>
Project Member
Tue 20 Oct 2015 10:08:24 PM UTC, original submission:  

Image 2.4.1 tries to keep compatibility between the old "general" inputParser and new Octave 4.0 inputParser method.

An undesired side effect of this is that the DisplayRange parameter of montage.m is unusable from Octave 4.0--the montage is unscaled, and difficult to see detail for wide dynamic range images.

Replacing the if-else with try-catch is a simple catch-all fix, better to ask forgiveness than permission solution.

Patch to montage.m attached.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35246:  image_patch.txt added by None (584B - text/plain - Patch file for image-2.4.1: montage.m)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mhirsch (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-23 carandraug StatusNone => Fixed
        Open/ClosedOpen => Closed
    2015-10-20 None Attached File- => Added image_patch.txt, #35246

    Back to the top


    Powered by Savane 3.5