Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Wine/Spider Monkey Panel/Script bugs on Linux (Read 13669 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #51
Ah yes, I meant to link here...

https://ci.appveyor.com/project/TheQwertiest/foo-spider-monkey-panel/builds/42696596/job/gjt89h4p5y76dr69/artifacts

Thanks.

But copy-paste continoues to give me a crash

Code: [Select]
Error: Spider Monkey Panel v1.6.2-dev+7c0928bf ({3F91DEBE-38E0-4E81-9F34-32FCD36EF5EB}: Library Tree v2.2.0 by WilB)
WinAPI error:
  ActiveXObject failed with error (0x80004001):
    No implementado.

File: search.js
Line: 288, Column: 5
Stack trace:
  on_char@search.js:288:5
  on_char@callbacks.js:39:9

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #52
Show me the changes you made to the scripts, before and after.

As an example, I had to replace this line of code in my copy of JSPlaylist

Code: [Select]
cInputbox.doc.parentWindow.clipboardData.setData("Text", this.text_selected);

with this...

Code: [Select]
utils.SetClipboardText(this.text_selected);

Depending on the complexity of the scripts, there could multiple instances where code like this would need updating.

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #53
Show me the changes you made to the scripts, before and after.

As an example, I had to replace this line of code in my copy of JSPlaylist

Code: [Select]
cInputbox.doc.parentWindow.clipboardData.setData("Text", this.text_selected);

with this...

Code: [Select]
utils.SetClipboardText(this.text_selected);

Depending on the complexity of the scripts, there could multiple instances where code like this would need updating.

No changes at all, i install a new one to test.

So is not that easy as install a new SMP version. The scripts needs an update too.

Right now i'm using Biography and library tree. Any idea what i need to modify?

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #54
Well every single instance of the old code will contain parentWindow.clipboardData. That's something to search for. I already gave an example of how to replace the code in my previous post.

Perhaps you should just wait and see if my pull request is accepted, and if it is, some script authors *might* update their scripts.


Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #55
Well every single instance of the old code will contain parentWindow.clipboardData. That's something to search for. I already gave an example of how to replace the code in my previous post.

Perhaps you should just wait and see if my pull request is accepted, and if it is, some script authors *might* update their scripts.

Sure, changes the code is above my nonexistent coding skills.  ;D

Thanks man

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #56
Thanks a lot @marc2k3!

Really nice, this means I can re-enable the clipboard func for the library and biography without crashing foobar right?
Will update my code when @TheQwertiest merges the code and I have time to test it 8)

This means I only have the drag and drop problem in the playlist under Wine...

-TT

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #57
ignoring my own advice i have been trying to test the new features.

In Biography v1.2.0 (by WilB) I made the next changes in menu.js

In line 1015
Code: [Select]
this.docTxt = doc.parentWindow.clipboardData.getData('text');
to
Code: [Select]
this.docTxt = utils.GetClipboardText();

And the menu paste text from clipboard works  8)

In Library Tree v2.2.0 (by WilB)  I made the next changes in search.js

In line 223
Code: [Select]
if (this.start != this.end) this.doc.parentWindow.clipboardData.setData('text', panel.search.txt.substring(this.start, this.end));
to
Code: [Select]
if (this.start != this.end) utils.SetClipboardText(text, panel.search.txt.substring(this.start, this.end));

In line 227
Code: [Select]
iif (this.start != this.end) this.doc.parentWindow.clipboardData.setData('text', panel.search.txt.substring(this.start, this.end)); // fall through
to
Code: [Select]
if (this.start != this.end) utils.SetClipboardText(text, panel.search.txt.substring(this.start, this.end)); // fall through

In line 290
Code: [Select]
text = this.doc.parentWindow.clipboardData.getData('text') || ''; // fall through
to
Code: [Select]
text = utils.GetClipboardText() || ''; // fall through

In line 387
Code: [Select]
his.paste = this.doc.parentWindow.clipboardData.getData('text') ? true : false;
to
Code: [Select]
this.paste = utils.GetClipboardText() ? true : false;

and the copy, cut and paste in the search field works  8)

Of course changes was made by trial and error without coding knowledge so could be an aberration. Any help will be welcome  :D 


Thanks @marc2k3






Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #58
This is incorrect.

Code: [Select]
if (this.start != this.end) utils.SetClipboardText(text, panel.search.txt.substring(this.start, this.end));

It only expects a single argument but you've inserted an unexpected variable named text so it should be this like this....

Code: [Select]
if (this.start != this.end) utils.SetClipboardText(panel.search.txt.substring(this.start, this.end));

Also, using || ''; is not necessary now

Code: [Select]
text = utils.GetClipboardText() || '';

It can be simplified to...

Code: [Select]
text = utils.GetClipboardText();

The component already returns an empty string if the clipboard contents are not text.

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #59
Thank you @marc2k3

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #60
Hi,

I've encountered a SMP/GDI+ bug when it tries to load a JPG image with an unusual ICC profile embedded, although there seems to be no problem on Windows, it crashes on Linux/Wine:

Code: [Select]
GdiPlus error: DrawImage failed with error (0x7): Win32Error 

Can someone confirm this? Will forward this to @TheQwertiest...
I've used Wine 6.0.1 with original GDI+ with all required dll's ( wsh57, mdac28 ) and @marc2k3's SMP v1.6.2-dev+7c0928bf ( would be the same with 1.6.1 ).

For now, I've solved this issue by adding a try catch when drawing/resizing an image...

The image has an Generic Gray ICC profile embedded.

-TT

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #61
It's unlikely anything can be done because the component is just using windows APIs. Seems very much like a WINE bug??

But you could test default UI/columns UI. Try the artwork panels/CUI playlist view.

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #62
@mark2k3,

I've tried pure Columns UI with playlist and artwork view and the cover.jpg is loaded and displayed correctly without any crash in Wine.
Also tried your samples -> album art.js and thumbs.js with a SMP and it starts to crash with the same error...
It seems that it is a SMP bug, but it's really weird that the cover.jpg with the embedded generic gray icc profile does not crash on Windows...

But few days ago a user reported the same error on Windows but this time with a corrupt image:
https://github.com/TT-ReBORN/Georgia-ReBORN/issues/66
that's why I've started to debug it...

Also this problems relates to this old discussion from 2019 in WilB's Biography thread:
https://hydrogenaud.io/index.php?topic=112914.msg976737#msg976737
https://hydrogenaud.io/index.php?topic=112914.msg977175#msg977175

-TT

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #63
JSP/SMP respect the colour profiles embedded in images and DUI/CUI don't. It's clearer in this example...



Disabling support for embedded colour profiles would probably "fix" your issue but then break the display of images like the one above.

I suppose you could argue that DUI/CUI have many more users and I've not seen any complaints for the existing behaviour so maybe these horrible scripting components should be updated to do the  same.

edit: i don't have to change JSP as it won't run on WINE.  :P


Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #64
Hi TT

I'm using the modified version of SMP made by marc (Build: 15:49:00, Feb 24 2022), a biography modified to use it with wine-7.6 (Staging) and the image load.



https://imgur.com/a/u7IApId


Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #65
Hi paregistrase,

Interesting! I'll try wine-7.6, maybe they're using a newer GDI+ version which fixed it?!
Do you also have 6.0.1 installed and can test it with this version? This would help a lot to know :)

-TT

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #66
Hi paregistrase,

Interesting! I'll try wine-7.6, maybe they're using a newer GDI+ version which fixed it?!
Do you also have 6.0.1 installed and can test it with this version? This would help a lot to know :)

-TT

Sure no problem. I'll try stable

wine-6.0.4 new 32prefix without any modification load the image too


https://imgur.com/a/NkiSfb1

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #67
Can you test this image which I used for my JSP/DUI comparison a few posts up.

https://camo.githubusercontent.com/103a0f0301f70dcb0883cd2c83b02567d67f22838d6b2e15ca3d08817118bac4/68747470733a2f2f70686f746f73617563652e6e65742f696d616765732f72617370626572726965732d637267622e6a7067


Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #69
So completely different to how you view it in your browser or the right hand pane in my screenshot a few posts up. Those berries should be red!

Still, displaying the wrong colours is better than throwing an error and it has parity with fb2k itself/facets/CUI.



Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #70
So completely different to how you view it in your browser or the right hand pane in my screenshot a few posts up. Those berries should be red!

Still, displaying the wrong colours is better than throwing an error and it has parity with fb2k itself/facets/CUI.

Correct, in firefox is red.

Also in the file manager preview is blue like in foobar but when i open it in any image viewer is red

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #71
So I've tried Wine 7.6 with a 32 prefix and I got mixed results...

With pure Columns UI ( no SMP panel ), playlist and artwork view in Columns UI, the cover.jpg with the embedded Generic Gray ICC profile is loaded without any crash. Marc's image with the berries, the ICC profile is ignored = blue berries.

--------------------------------------------------------------------------------------------------------------

Now if I try with a SMP panel and Marc's samples Album art.js and Thumbs.js:

Blue berries in Album art.js

and crash in Thumbs.js:
Code: [Select]
Error: Spider Monkey Panel v1.6.2-dev+7c0928bf ({AD15D11D-34C8-46F7-B13B-1D017BA1849A}: Thumbs by marc2003)
DrawImage failed:
GdiPlus error: DrawImage failed with error (0x7): Win32Error
File: helpers.js
Line: 175, Column: 6
Stack trace:
  _drawImage@helpers.js:175:6
  _thumbs/this.size/<@thumbs.js:74:6
  r@lodash.min.js:5:356
  Xe@lodash.min.js:67:74
  _thumbs/this.size@thumbs.js:73:7
  on_size@thumbs.js:16:9

--------------------------------------------------------------------------------------------------------------

The cover.jpg with the embedded Generic Gray ICC profile crashes in both:

Album art.js:
Code: [Select]
Error: Spider Monkey Panel v1.6.2-dev+7c0928bf ({F1C40D43-2658-44E2-9626-880BCDD56B0B}: Album Art by marc2003)
DrawImage failed:
GdiPlus error: DrawImage failed with error (0x7): Win32Error
File: helpers.js
Line: 175, Column: 6
Stack trace:
  _drawImage@helpers.js:175:6
  _albumart/this.paint@albumart.js:23:4
  on_paint@album art.js:22:11

Thumbs.js:
Code: [Select]
Error: Spider Monkey Panel v1.6.2-dev+7c0928bf ({AD15D11D-34C8-46F7-B13B-1D017BA1849A}: Thumbs by marc2003)
DrawImage failed:
GdiPlus error: DrawImage failed with error (0x7): Win32Error
File: helpers.js
Line: 175, Column: 6
Stack trace:
  _drawImage@helpers.js:175:6
  _thumbs/this.size/<@thumbs.js:74:6
  r@lodash.min.js:5:356
  Xe@lodash.min.js:67:74
  _thumbs/this.size@thumbs.js:73:7
  on_size@thumbs.js:16:9

--------------------------------------------------------------------------------------------------------------
 
The cover.jpg with the embedded Generic Gray ICC profile in Georgia-ReBORN's Playlist crashes ( would be the same in Biography but WilB added a try catch ):
Code: [Select]
Error: Spider Monkey Panel v1.6.2-dev+7c0928bf ({04620F16-1878-47A1-8EFE-0CE0B99566CC}: Georgia-ReBORN v2.0.3b by TT)
Resize failed:
GdiPlus error: DrawImage failed with error (0x7): Win32Error
File: main.js
Line: 4517, Column: 21
Stack trace:
  assign_art@main.js:4517:21
  getHeaderArtwork/</<@main.js:3017:12

Blue berries displayed in Georgia-ReBORN's Playlist and Biography with no crash...

--------------------------------------------------------------------------------------------------------------

So yea that's a really weird bug, it could be either a GDI+ bug ( maybe different versions handle it different ) or a bug in the SMP image.Resize() callback?
The cover.jpg with the Generic Gray ICC profile does make more problems than your custom ICC profile in your berries image...


-TT

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #72
The .Resize function uses the same windows APIs as DrawImage. It's not an SMP bug - you're just encountering the same WINE gdiplus bug in different places.

If anyone wants to build their own copy of SMP without colour profile support so it behaves like CUI/DUI/facets etc, the TRUE needs replacing with FALSE on these 2 lines of code....

https://github.com/TheQwertiest/foo_spider_monkey_panel/blob/00b8cee40801f9594fcb45fbd578e9b91c1304a3/foo_spider_monkey_panel/utils/art_helpers.cpp#L114

https://github.com/TheQwertiest/foo_spider_monkey_panel/blob/00b8cee40801f9594fcb45fbd578e9b91c1304a3/foo_spider_monkey_panel/utils/image_helpers.cpp#L136

Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #73
It is a weird situation, I'm unable to crash SMP in any of the situations that crash for TT.
I installed Georgia-ReBORN and load the images without crashes.









Re: Wine/Spider Monkey Panel/Script bugs on Linux

Reply #74
@TT

At least I managed to get your crash  8)

Installing the GDI+ winetricks verb gives me your Win32Error.

Removing the verb and installing the XP verb version avoid the crash but get a weird yellowish display of both images.







Without any verb the images load without crash or weird effect (besides the lack of ICC)