R143 Image Data URI causes "Dialog Screen" Bug

Bugs will be moved here once resolved.

Post » Mon Sep 09, 2013 10:55 am




Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/65841566/R143DialogBoxLoadDataURIBug.capx




Steps to reproduce:
1. Use some png example https://dl.dropboxusercontent.com/u/65841566/SpriteFont_Andy_Bold_%2824%29_%5BLeft%2C0%2C0%2C0%5D_35x35.png

2. Go to http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/   and convert to data uri

3. Create new project
4. Add 1 Sprite Object
5. In event add System->"On Start Of Layout"
6. add action "Sprite"->"Load Image from URL"
7. Paste the data URI in dialog box.

Observed result:
The dialog box become too big until the "OK" "Cancel" "Back" button is missing. Even if I press enter after that, all dialog box will be broken and I have to end construct 2 in task manager. I have to open construct 2 preferences and click reset dialog.

If you open my capx file, just open it in construct and click on the event of "load image from url" to open the dialog screen. After that my construct is unstable.


Expected result:
Everything should be fine. Maybe add vertical scroll and horizontal scroll into the textbox in dialog screen ?

Browsers affected:
Chrome: no
Firefox: no
Internet Explorer: no

Operating system & service pack:
Windows 8

Construct 2 version:
   R143
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Tue Sep 10, 2013 11:09 am

I sort of had the same thing but instead i was pasting like 40 lines of JSON code into the input box after which it looks like this:



There doesn't seem to be any way to reverse since from now on all my input boxes look like this. :/
B
7
S
2
Posts: 38
Reputation: 555

Post » Tue Sep 10, 2013 12:32 pm

@hdnine only way to fix it for now is to reset dialog screen in preferences
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Tue Sep 10, 2013 2:51 pm

This is a ridiculous thing to do in the first place, since it would be much better to import the PNG as a project file and load it from an actual URL rather than a data URI. Even if for non-image content you have large amounts of data, it makes far more sense to paste them in to a text file, import them as a project file, and AJAX request them. You should never be pasting large amounts of data in to events.

However to prevent the dialogs disappearing/corrupting, I've implemented a maximum height for the next build. The dialog still won't display correctly, but you shouldn't be doing this in the first place.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Wed Sep 11, 2013 12:55 am

@Ashley

Thanks for implementing the fix. I have my own reasons why I`m doing stuff like this in the first place.tumira2013-09-11 01:32:57
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Wed Sep 11, 2013 1:14 am

If you must have a string I'd suggest saving it as a text file, and adding it to the projects resources like Ashley suggested.
The Ajax plug will then have access to it, and you can use it in several ways.

Also sometimes its easier to paste a string into a variable. It seems to handle things like that better, however it does seem to have a lower limit for the length of the string.newt2013-09-11 01:19:35
Image ImageImage
B
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Wed Sep 11, 2013 1:30 am

@newt ,thanks for the suggestion. Again, I have my reasons to try and do this. It is a bit bizarre. But it meets my requirement. The capx is just an example, I wont be doing stuff exactly like that in the projects.tumira2013-09-11 01:31:10
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Thu Sep 12, 2013 1:11 pm

@tumira Thanks for the tip... worked perfectly. Didn't know about that feature. ^^
B
7
S
2
Posts: 38
Reputation: 555


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest