Skip to content
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

Chrome - Download Failed Network Error #3

Open
PeteMoog opened this issue Apr 2, 2018 · 8 comments
Open

Chrome - Download Failed Network Error #3

PeteMoog opened this issue Apr 2, 2018 · 8 comments

Comments

@PeteMoog
Copy link

PeteMoog commented Apr 2, 2018

Just to start this is great software, I love it.

I am trying to save large images using chrome but when I resize to around 4000px x 4000px and refresh then hit "save current image" Chrome notifies me of "Download Failed - network Error".

I have had a look at the HTML in firebug it appears its a chrome problem.. https://stackoverflow.com/questions/37135417/download-canvas-as-png-in-fabric-js-giving-network-error/

The stackoverflow article suggests it might be fixable using Blobs.

In the meantime I have downloaded Firefox and it runs OK there (well at least I have not reached an upper image size yet). The exact image size that this occurs depends how intricate the image being downloaded is.

I am using Chrome Version 64.0.3282.186 (Official Build) (64-bit),

@akx
Copy link
Owner

akx commented Apr 2, 2018

Thanks for the heads-up!

Looks like downloading images of that size and/or complexity (after all, the more complex the image is, the less it can be compressed, so that makes sense) is indeed screwy - on my Chrome, instead of "Download Failed - Network Error", I get an about:blank tab, which is equally weird.

It shouldn't be too hard to add blob URL based downloading. Hold on... :)

akx added a commit that referenced this issue Apr 2, 2018
This should resolve problems downloading large files.

Refs #3
@akx
Copy link
Owner

akx commented Apr 2, 2018

Okiedoke! I've updated the live version at http://akx.github.io/glitch2/ with code that attempts to use Blob urls if they are supported by your browser. Let me know if things work better now (or if I've broken something - I updated some other things too 😅)!

Also, as a late april fools gift (that's totally a thing, right?) I also added a new utility effect xform, for that good ol' flipping-and-rotating fun.

@akx
Copy link
Owner

akx commented Apr 2, 2018

ps. @PeteMoog, I'm honored that your first ever GitHub issue should be on my project :D Thanks 😻

@PeteMoog
Copy link
Author

PeteMoog commented Apr 3, 2018

Yes, I've have finally signed up, just to report the issue and say thanks.... another virginity (sort of) lost.

Just a quick couple of Qs

  1. when I create an effect I like which involves some degree of chance/randomness is it possible to replay the exact same glitch on another image with the same random/chance values that were just used? I dont know how well this would work or even if its a good idea as I understand many of the effects are totally dependent on the image itself.

  2. for ideal workflow I would (combination of speed and ease) I would like to create smallish (1000x1000) images and when I find one that I like resize it larger, however Resize > Refresh creates a new and different image. Currently 6000x6000 images take around 15 secs to render and I am sure as I introduce more effects that will increase. I could work slowly by zooming out to see the complete image then zoom in to be see the controls again but it would still be a slow process as I wait for the renders.

I guess maybe something like a **Re-**Refresh might solve my 2 workflow issues but could you recommend anything relatively easy I could do with the code/html myself to achieve these issues myself(especially Q2)?

Thanks for the quick fix, I have tested it in Chrome sand it seems to be working a treat.

I will give xform a play this afternoon.

@akx
Copy link
Owner

akx commented Apr 3, 2018

As for randomness, it's currently using a non-seedable random number generator (Math.random()), so that would have to be changed to allow for replayability of a given glitch. That's not a problem in itself.
However, many effects are dependent on the size of the image, so even with a seedable random number generator the effect would likely be different when the image is resized. :/

As for the UX of working with large images, I can easily add a zoom control for the image (or even "fit to viewport"), so you could see the controls alongside a zoomed-out version of the image. That won't help with the render times though, I'm afraid.

@PeteMoog
Copy link
Author

PeteMoog commented Apr 3, 2018

Yes, I half suspected that the same glitch could not be reproduced on the same image but I guess it might be interesting to see how much the input image affects the output with various effects for a fixed (randomly generated or user defined) seed value. A feature for the next release perhaps...

If it's an easy addition those ideas would certainly help, I guess if you added "fit to viewport" as a selectable option it would do the job, although at times it may be helpful to zoom into an image to see the actual detail on larger output images.... it would be a very useful feature when working on larger images.

I guess I can have to live with render times.. I do notice that CPU and GPU %load are very low whilst rendering, I they cannot be multithread by windows/chrome.

@akx
Copy link
Owner

akx commented Apr 4, 2018

Yeah, the generation process is definitely very single-threaded.

Anyway, I added a "zoom down to fit" checkbox :)

@PeteMoog
Copy link
Author

PeteMoog commented Apr 7, 2018

It works a treat, I am having fun. many thanks.

I am now trying to do 4 in parallel in different tabs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants