Conversation
| case 'size': | ||
| { | ||
| this._imageSize = message.value; | ||
| const { size } = fs.statSync(resource.path); |
There was a problem hiding this comment.
Many of the images we load are not on the file system. They may be remote or data uris, which fs will not understand
Try using VS Code's file system api instead:
Line 5976 in 623bae8
mjbvz
left a comment
There was a problem hiding this comment.
I think the binary size should be a new status bar item. That way users can disable the dimensions or binary size independently.
See SizeStatusBarEntry for a good starting point for creating the new status bar item. The BinarySize class can also live in that new file
| { | ||
| this._imageSize = message.value; | ||
| this.update(); | ||
| vscode.workspace.fs.stat(resource).then(stat => { |
There was a problem hiding this comment.
This should not happen inside the message handler. The image's dimensions and binary size should be computed independently
|
Thanks! Will be in the next VS Code insiders build and is scheduled to go out with VS Code 1.41 |
This PR fixes #84111