-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload local image in Windows #61
Comments
Hello @lukefan6 , Would you please be able to walk me through your fix because I have the same issue and unable to fix it? I know almost zero about TS and JS. I've tried making the modification you mention in my installed version of md2googleslides (ie not the GitHub repos I cloned), in the location Note, I'm using a forked version fly @wescpy that has updated various things including the OAuth. Is there a way I can fix it in my installed version (or can you guide me how to do a PR for wescpy bearing in mind my non-existent TS and JS skillset!). Thanks. |
@py9mrg I haven't been following this for quite a long time. As you can see, my post was in 2019, that's almost 4 years ago, and I believe the source code architecture has changed a lot since then. That said, what I am able to help you now is try to locate the code, so I used the GitHub history feature to find out what the code looked like 4 years ago, and here it is: I guess now you can go checkout the latest version of the file const size = await probeFile(parsedUrl.pathname); Then, you should be able to modify it and try the hack that I was able to do 4 years ago. As for compiling and running the modified code, I'm afraid I have to tell you that I don't remember how I did it 4 years ago. My recommendation is that you ask some other contributors to this project as they are the TS and JS experts and are supposed to answer the how-to-get-it-running questions. That's all I have now, good luck to you, cheers! |
Thanks a lot. The project has been largely dormant for those 4 years, apart from some extremely helpful authentication work by @wescpy, so it might be the case that your fix works as is! I'll give it a go, thanks a lot for the advice. |
Sorry for the delay, it's taken me some time to have a chance to test this. @lukefan6 you are a hero, I had to make a couple of modifications but using your guidance I could work it out and finally have it working after years of trying (admittedly very sporadically)! Now both local images and equations (which use local images) work fine. tl;dr I needed to add Edit [ into something like this: @wescpy hope everything is ok with you - I can do a pull request on this but I am reluctant to initiate it because this might just be a Windows thing so I think it's likely it could break it for everyone else. I will try to get a chance to test it on Linux / (very old) macOS when I have the chance. |
@py9mrg Congratulations on your success, I'm so happy for you! |
Let's say I have a local image file called
my-code-doesnt-work.jpg
alongside my markdown slide and I simply add it to the slide like this:When I executed the converter, error message popped out as follows:
After some hacking I was able to pinpoint the cause to this line of code:
https://github.com/gsuitedevs/md2googleslides/blob/master/src/images/probe.ts#L62
I used
console.log
to print theparsedUrl.pathname
and the result wasThen it was passed to
fs.createReadStream(path);
and that's where the error came from.I can hack it to resolve my issue by using
fs.createReadStream(path.substring(1));
but obviously it's not an ideal solution and I have no idea whether it will affect macos / linux or not.Any ideas?
The text was updated successfully, but these errors were encountered: