bugGNU Octave - Bugs: bug #54697, uicontrol: cdata does not work...

 
 

bug #54697: uicontrol: cdata does not work with uint8

Submitter:  None
Submitted:  Thu 20 Sep 2018 02:13:15 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  joemalk Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 22 Sep 2018 03:46:13 PM UTC, comment #5: 

Also tested on a cross-compile for Windows.
Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Sat 22 Sep 2018 02:27:02 PM UTC, comment #4: 

That should be fixed with this changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/54635fcf99b8

Markus Mützel <mmuetzel>
Group administrator
Thu 20 Sep 2018 07:01:53 PM UTC, comment #3: 

Oh, thanks for clarifying. I didn't get that context from the report. I can confirm that it does error with uint8 data, works with a scaled double array.

Mike Miller <mtmiller>
Group Member
Thu 20 Sep 2018 06:41:32 PM UTC, comment #2: 

I asked Joseph to open a bug report because I think CData should accept uint8 data (which it currently doesn't).

Re-opening for this specific issue.

Markus Mützel <mmuetzel>
Group administrator
Thu 20 Sep 2018 03:32:22 PM UTC, comment #1: 

Thank you for your bug report. Yes, I think you have read bug #44332 correctly. This bug is identical to that bug, so I am closing this as a duplicate. The feature has been implemented for the future Octave 5 release and does work for me.

Mike Miller <mtmiller>
Group Member
Thu 20 Sep 2018 02:13:15 PM UTC, original submission:  

I have installed, on MacOS High Sierra, the homebrew installation of Octave, ver 4.4.1_1, using the --with-qt option. When I input


myimage=imread('floppy.png')
myfigure = figure()
myuicontrol = uicontrol("parent",myfigure,"cdata",myimage,"style","pushbutton")


I get the following error message:

error: invalid value for array property "cdata"
error: _go_uicontrol_: unable to create graphics handle
error: called from
    uicontrol at line 109 column 8

This is because cdata is not expected to be a uint8. But, even after you convert myimage to double (and divide by 255), namely using


myuicontrol =
uicontrol("parent",myfigure,"cdata",double(myimage)/255,"style","pushbutton");


the error goes away, but the image still does not get displayed. Looking at comment #2 in

https://savannah.gnu.org/bugs/index.php?44332

it looks like cdata will be implemented in version 5.0. Does it mean it is not yet correctly implemented yet?

An even more minimalistic example is:


uicontrol("parent",myfigure,"cdata",zeros(36,36,3),"style","pushbutton");


(or even if one replaces zeros(36,36,3) by ones(36,36,3))

one gets only a blank button, in all cases. See the attached image.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45060:  floppy.png added by None (222B - image/png)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  •  

    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 17 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-22 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-09-22 mmuetzel StatusConfirmed Ready For Test
    2018-09-21 mtmiller CategoryPlotting Plotting with OpenGL
        Severity3 - Normal 2 - Minor
        Item GroupIncorrect Result Matlab Compatibility
    2018-09-20 mmuetzel CategoryGUI Plotting
        StatusDuplicate Confirmed
        Open/ClosedClosed Open
        Release4.4.1 dev
        Operating SystemMac OS Any
        Summaryuicontrol function with cdata does not work correctly uicontrol: cdata does not work with uint8
    2018-09-20 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #44332
    2018-09-20 None Attached File- Added floppy.png, #45060
        Attached File- Added Screen Shot 2018-09-20 at 5.11.02 PM.png, #45061

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code