-
Notifications
You must be signed in to change notification settings - Fork 247
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
Import Image UI (allows for importing via URLs and by local image file #30
Import Image UI (allows for importing via URLs and by local image file #30
Conversation
…textures within the current shader. NOTE: THIS IS NOT FINISHED YET
…path of the image to loadImageFile main method.\n2.Refactored selecting options for both getting local/URL files.\n3.Created new error handling cases, including checking if currently in Chrome if attempting to import a local file, and if the image is not an image file for importing images via URLs.\n\nTODO: Catch CORS failures since many images on servers fail this test.
…ot written in the shader.
thanks for the patience @ChronoAndross. Although loadImageFile using base64 it's a great idea to keep shaders compact and independent, it relays on the space on my server which I pay only with donations. That's a pattern that I don't wish to promote. Do you mind taking out that feature? |
@patriciogonzalezvivo I can take out that feature and just accept paste the local file path and submit that today. Thanks for getting back to me! |
Actually, now I'm looking back at my code, I know why I did it this way to begin with. I did it this way since the input tag won't give me a full local file path by default because of security reasons, and I don't think I can get around this. Should I just disable the feature, or should I just change the UI so that the user gets the same dialog when importing a URL image? Thanks! |
… we can cut down on the size of the shader. Also took out anything concerning data64 as input upon request. WARNING: The texture won't show upon local import this way since the Texture.js code keeps rejecting the local URI. This has to be changed from OP's side since that code is not presently in the repo. This doesn't even work in the present builds of glslEditor.
Okay so I've changed my code to just paste the local path, but local imports don't presently work since the Texture.js code keeps rejecting local URIs. I can't directly change this code. @patriciogonzalezvivo is this something you can do? I'm betting it has something to do with loading the local image data. This is why I loaded the data using base64 since a base64 stream can be read locally fairly easily. Thanks! |
Yes using URL to the cloud (checking previously that don't raise CORS issues) should be the only way to import an image. Why?
For then, remotes URL with no CORS issues should be the only available option. People need to host their own images using dropbox or another services |
The code changes that are made here are as follows:
NOTE: This does not capture CORS requests if they occur in these instances. I was going to attempt to try this, but the response for CORS happens to far in the call stack to catch it. Perhaps I'll work on this at some other point.
For more information about the behavior of this new feature, please look at my latest comment in this issue: #29
Thanks!