satiromarra / vscode-sftp

Super fast sftp/ftp extension for VS Code
Other
23 stars 3 forks source link

View images - like a local folder #32

Closed MKaidan closed 1 year ago

MKaidan commented 1 year ago

Is this a similar or duplicate feature request?

Is your feature request related to a problem? Please describe. When I click on a file, such as a PHP file, it opens the file in a tab. When I click on an image file, I get an error:

Detail: File seems to be binary and cannot be opened as text

Describe the solution you'd like Image files should open up in a tab just like they do in a local folder/directory.

Describe alternatives you've considered Download the file and open locally, which requires more steps and can be avoided.

Does this project help you?

satiromarra commented 1 year ago

@MKaidan I have been working on this improvement for quite some time and I have not achieved anything that would satisfy me, and I have left it aside. Opening any media file can cause problems, in this case we are talking about images, but video files that occupy several megas or gigas? What I thought was to restrict the opening of media files, that is, that when you select it you don’t do anything.

MKaidan commented 1 year ago

Why not start with getting images to work, and then worry about video?

What is the concern with video exactly? Timeout when downloading the file from the server?

satiromarra commented 1 year ago

@MKaidan Video or any other type of large file. I’ll try to do some.

satiromarra commented 1 year ago

@MKaidan Can you try this beta? v1.17.11-beta1

MKaidan commented 1 year ago

The beta still gives me an error when I try to open an image file: cannot open file://[file path]. Detail: File seems to be binary and cannot be opened as text

satiromarra commented 1 year ago

@MKaidan What image extension?

MKaidan commented 1 year ago

.jpg, .png, and .gif

satiromarra commented 1 year ago

@MKaidan Among other things, I have uploaded a new beta with some more checks. When a file is selected and its extension is in the list of images, the temporary image is downloaded and opened. ['.jpg', '.jpeg', '.svg', '.bmp', '.png', '.gif', '.tiff']

Captura de pantalla 2023-04-14 a las 18 31 03

Try beta3 and let me know.

MKaidan commented 1 year ago

That's strange - I still cannot open any of those files.

MKaidan commented 1 year ago

I should mention that the SFTP folder that I'm in, is on a local server in my office. So the files are not on my local drive but on the server which I have access to. I'm not sure if that should be a problem because all text files open, but I thought I should let you know.

MKaidan commented 1 year ago

Also this is a Windows environment, not Mac or Linux.

satiromarra commented 1 year ago

Try:

I should mention that the SFTP folder that I'm in, is on a local server in my office. So the files are not on my local drive but on the server which I have access to. I'm not sure if that should be a problem because all text files open, but I thought I should let you know.

No problem, That's the idea to open the remote images.

Also this is a Windows environment, not Mac or Linux.

Coincidentally the OS I don't use :P

MKaidan commented 1 year ago

Still the same.

satiromarra commented 1 year ago

The message [2023-04-14 13:57:26] [info] remote ➞ loca ... should not come out when you select a remote image in "Remote Explorer"

Captura de pantalla 2023-04-14 a las 20 15 09
MKaidan commented 1 year ago

Sorry, I should have specified I turned on logging to see what was happening. That was what the log told me.

Here's what I'm seeing: [redacted]

satiromarra commented 1 year ago

Is this option disabled?

image
MKaidan commented 1 year ago

It's enabled. image

MKaidan commented 1 year ago

When I disable it, close, and reopen VS Code, I now see this: [redacted]

satiromarra commented 1 year ago

That is the cause of the problem, i have not considered that option.

I have reuploaded the beta3 version again with some improvements. Enable: Download When Open In Remote Explorer

MKaidan commented 1 year ago

It's working perfectly now!

Will you be releasing this version?

satiromarra commented 1 year ago

Yes, with some improvement, it will be published shortly in version 1.17.11.

MKaidan commented 1 year ago

Thank you, I meant a GitHub release as well though.

MKaidan commented 1 year ago

Also the popup "We're working on previewing images" still comes up. @satiromarra

satiromarra commented 1 year ago

😫