October 17, 2018, 10:34:13 PM

Author Topic: Strange MaxIDE bug  (Read 254 times)

Offline TomToad

  • Sr. Member
  • ****
  • Posts: 327
Strange MaxIDE bug
« on: July 16, 2018, 09:05:41 PM »
ran across a very odd bug in MaxIDE today.  It affects both vanilla and NG versions.  It's not a major bug, but the results were very interesting.  Thought I'd share it via YouTube video. :)
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1354
Re: Strange MaxIDE bug
« Reply #1 on: July 16, 2018, 09:16:27 PM »
That is a windows-only thing I assume.

Why?
In Linux the Drag'n'Drop or "ctrl + c" is actually copying the URI (file path) of the image. So pasting it into MaxIDE (does not matter if GTK, FLTK - or a scintilla-textarea instead of the maxgui-one) results in pasting eg.
/home/ronny/Arbeit/Programmieren/Tools/cerberus/examples/mojo2/rendererdemo/rendererdemo.data/t3_SPECULAR.png
instead of the content of this image file.



I tried it in my XP-vm and it did not paste the image there - so maybe the underlaying textarea-widget changed from then to yours? BTW it pasted "nothing", so no URI, no image.


bye
Ron

Offline therevills

  • Sr. Member
  • ****
  • Posts: 366
Re: Strange MaxIDE bug
« Reply #2 on: July 17, 2018, 04:27:42 AM »
I first I thought the bug was the bubbles ;)

It would be cool if the tank was saved in the code... imagine the code you could write!

Offline TomToad

  • Sr. Member
  • ****
  • Posts: 327
Re: Strange MaxIDE bug
« Reply #3 on: July 17, 2018, 11:28:23 AM »
This is a very strange "bug" indeed.  Seems that it is actually the unicode character $FFFC being saved in the file.  This "bug" also appears in a maxgui textarea, GadgetText(TextArea) also returns the code $FFFC.  Where does the actual image exist?

Screenshot shows a textarea with a bunch of images.  The status bar on the bottom shows the hex value of what is actually written to the text area.
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline col

  • Sr. Member
  • ****
  • Posts: 397
Re: Strange MaxIDE bug
« Reply #4 on: July 17, 2018, 11:30:49 PM »
Nice find!  :)

As far as I can remember the win32 text area is a richedit control backed by an OLE object for the data. The image would be stored in the OLE object data. The text is only a part of the data available so I would expect you need to use other win32 APIs to extract correct information regarding the image, including saving and loading it correctly in order to keep image intact.

Correct me if I'm wrong but I believe the MaxIDE uses the same textarea gadget from MaxGUI, and the NG IDE now uses scintilla... which also has the 'image in text' feature.
Any bugs in my code are proof of its hand-coded nature.
https://github.com/davecamp