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

"download ... failed - Network error" on scaled images. #47

Open
stucka opened this issue Jun 6, 2016 · 3 comments
Open

"download ... failed - Network error" on scaled images. #47

stucka opened this issue Jun 6, 2016 · 3 comments

Comments

@stucka
Copy link

stucka commented Jun 6, 2016

We've got 1.1.0 running, and everything had been fine. On May 17, I tweaked the themes JSON just to reorder the entries. The file still validates. The server hasn't changed.

Now we're starting to get problems, at least mostly in Chrome, though a coworker says in Firefox. My Chrome was acting up. I get a message in the download bar:
download
Failed - Network error

This is happening on my default image, which is for Facebook at 600x315 at 2x or 3x scale. It also seems to be happening on other photo sizes at 2x or 3x. My temporary fix was to build a default at 1200x630 1x, which works just fine.

I get no console errors. Chrome developer tools show three files moving: JPG, PNG, SVG + xml ... And I get the same sorta three files for actual downloads and that "Failed - Network error."

Any ideas?

@chrishutchinson
Copy link
Owner

Hey @stucka,

This is interesting, I've noticed the same issue on one of our builds lately, but it's only happens occasionally and I haven't been able to get to the bottom of it yet.

Any chance you can provide details of your card config? Specifically do you have image components, are they editable / uploadable, and if so, how many are there?

I think it could be something to do with the size of the file that is produced by the SVGtoPNG process, but this is just a guess, I'd like to do more research 💭 ! Your notes are very helpful 👍

@chrishutchinson
Copy link
Owner

So - I haven't been able to test it in CardKit yet, but I've been doing some work on another project that was facing similar issues.

I think it may be due to the size of the data generated from the SVG > Canvas process. Converting this using (canvas.toDataURL('image/png')) is likely the issue. I've been able to change it to use canvas.toDataURL('image/jpg') in another project of mine and that has helped alleviate the issue.

The change would be made in CardKit here: https://github.com/times/cardkit/blob/423ba8fe5114ced961bad9f78e1bb03ffc1c0dbc/bower_components/saveSvgAsPng/saveSvgAsPng.js#L112

If you want to test it please try, I'll try and do the same when I get a chance - hopefully in the next day or two!

@stucka
Copy link
Author

stucka commented Jun 17, 2016

My cardkit build was ... actually a compiled version I took from somewhere else, I think, then with me mangling some of the json and js directly. I tried to get the cardkit git up and running but kept running into some weird bower conflicts on Windows and walked away. Probably shoulda tried under the Xubuntu VM, but I was just trying to get something working quickly and get going.

About the same time cardkit started acting up we started having intermittent problems with an image resizer, which is basically the old Vox meme generator with nearly all the functionality stripped out. cardkit of course has a common lineage there; my guess'd be something changed in how Chrome handles a piece of the Vox code that cardkit is still using.

And maybe now that I've sucked up some of your time, I probably ought to try again in both Windows and Xubuntu to get bower going again and/or to file another issue.

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

No branches or pull requests

2 participants