Image Picker 'Image access' limitations

I have had a long, drawn-out meeting with my mouse and it insists it has nothing to do with the issue.

2 Likes

Try to see if the problem also occurs here:

  1. http://code.appinventor.mit.edu/
  2. AI2Offline download | SourceForge.net (offline version of AI2).

If not, we might be able to isolate this issue...

OK, exactly the same issue here in AI2Offline. The work-around:

works.

Nothing immediately comes to mind as to why this is happening. @BeksOmega would you be able to take a quick look and file an issue with anything you learn?

2 Likes

@ChrisWard do you see any errors in the browser developer console when this happens? I think there is probably an exception being thrown by the drag handler based on your videos.

2 Likes

Honestly I have no idea why this is happening. I've never seen a block that's draggable but not rendered before.

I took a look at the relevant block definition, and everything seems to be in good working order. It's definitely doing some weird stuff with the asset filtering and whatnot, but nothing that should break rendering.

If there was an error trace or some repro steps I could help more, but at this point I'm stuck :confused:

1 Like

Looking at that code snippet, I see places where the file type affects how the block is handled.

Considering that

  • Chris Ward's example involves .webp files, and that
  • webp files were invented by Google, and that
  • the code snippets looks at possible dock targets based on type,
  • compatible file types might be inherited from the O/S,

I have to ask, does Chris Ward run his AI2 sessions on a flavor of Linux that does not have a file association for .webp files?

I don't believe that would be relevant for this. The block doesn't embed the media in any way, so the ability of the browser to read/write that file type shouldn't matter.

I'm working from just the file name suffix, ".webp", which is salient here, because I rarely see it appear in Media file lists of posted projects on this board.

As mentioned before, I'm on Windows 7. Also I have tested with PNG files. WEBP are of very small filesize and hence I use them whenever an image is never going to be up scaled.

There is one error mentioned: "Uncaught TypeError: b is undefined" - this is reported the moment a drag of a media block fails.

Uncaught TypeError: b is undefined
addField http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:47
init http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:47
Block http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:16
BlockSvg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:16
newBlock http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
domToBlockHeadless_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
domToBlock http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
placeNewBlock_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
createBlockFunc_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
onMouseMoveBlock_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
n http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
bindEventWithChecks_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
blockMouseDown_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
n http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
bindEventWithChecks_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
addBlockListeners_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
layout_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
show http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
showComponent http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
showComponent http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:27
bU http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:557
FV http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:62
RH http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
d3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
X_b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
n0b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:39
f0b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:30
mg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:468
wg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
Y_b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:55
C3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:233
o3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:31
B3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:45
Y3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
WLc http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:332
WNc http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:336
uSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:307
xSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:7
wSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:243
ai2.appinventor.mit.edu:47:42727
Uncaught TypeError: b is undefined
addField http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:47
init http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:47
Block http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:16
BlockSvg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:16
newBlock http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
domToBlockHeadless_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
domToBlock http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:14
placeNewBlock_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
createBlockFunc_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
onMouseMoveBlock_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
n http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
bindEventWithChecks_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
blockMouseDown_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
n http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
bindEventWithChecks_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
addBlockListeners_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
layout_ http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
show http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:19
showComponent http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:21
showComponent http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:27
bU http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:557
FV http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:62
RH http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
d3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
X_b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
n0b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:39
f0b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:30
mg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:468
wg http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
Y_b http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:55
C3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:233
o3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:31
B3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:45
Y3 http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:1
WLc http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:332
WNc http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:336
uSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:307
xSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:7
wSb http://ai2.appinventor.mit.edu/?locale=en line 9 > injectedScript:243
ai2.appinventor.mit.edu:47:42727
Saving fileId src/appinventor/ai_chrisward2k2/MediaBlockIssue/Screen1.bky for projectId 4985258927063040 ai2.appinventor.mit.edu:210:29
Cookie “_ga_6VSZEZ8HGQ” will be soon treated as cross-site cookie against “http://ai2.appinventor.mit.edu/ode/projects” because the scheme does not match. projects
Saving fileId src/appinventor/ai_chrisward2k2/MediaBlockIssue/Screen1.bky for projectId 4985258927063040 ai2.appinventor.mit.edu:210:29
Cookie “_ga_6VSZEZ8HGQ” will be soon treated as cross-site cookie against “http://ai2.appinventor.mit.edu/ode/projects” because the scheme does not match. projects
Saving fileId src/appinventor/ai_chrisward2k2/MediaBlockIssue/Screen1.bky for projectId 4985258927063040 ai2.appinventor.mit.edu:210:29
Cookie “_ga_6VSZEZ8HGQ” will be soon treated as cross-site cookie against “http://ai2.appinventor.mit.edu/ode/projects” because the scheme does not match. projects

Note that FireFox complains a lot about the structure of a cookie.

Thanks that helps narrow down the problem.

I was able to reproduce this exact same problem; along with your points, I suspect the amount of RAM available also has something to do with it.

This happened sporadically when only my browser (Microsoft Edge-Chromium 96.0.1054.62) was open, but almost always when PyCharm and/or Eclipse (2021-09) was open in the background.

In the first case, I had around 300MB of RAM available, but in the second, I had less than 200.

Furthermore, I wasn't able to get this behavior on my (mother's) laptop which has 16GB of RAM, not on a single browser installed.

This is the basis of my not-so-well-founded hypothesis.


Unfortunately, the console had no say in this, either. No "Oooops, we encountered an error;" "There was a problem opening randomFile.aia;" or "We could not save your file." Absolutely nothing.

Then again, Edge isn't the most reliable of browsers. I'll try Chrome and Firefox and edit this post once I obtain some (hopefully useful) information.

Then I would expect the problem to occur with Kodular and / or Niotron as well.

Btw, here is some information about one of my notebooks (without this issue, regardless of how many programs are running / loaded in the background):

grafik

1 Like

All,
I have a 16gb Windows11 & use Chrome. My original problem now appears to be intermittent. I seem to be able to fix it by Closing Chrome, and then I reopen it. The lost blocks are now seen on the screen.

A troublesome, but simple alternative method is to have previously saved these unusual blocks to DeskPack, and use them when needed. Charles

1 Like

Same here, but with Edge. And thanks for the tip, it works really well!

I believe that I have a fix for the issue. It seems to be caused by a changing variable that shouldn't be changed, but does when you scroll the block drawer. If you've got a big enough screen, you don't need to scroll and things work fine. When I shortened my browser window so that I had to scroll to grab the block I was able to consistently repro the error.

2 Likes

I don't (as hard as I try :wink:).

I don't either....