Raylehnhoff / SCFSD

Star Citizen Faction Ship Drawer
http://raylehnhoff.github.io/SCFSD/
MIT License
24 stars 8 forks source link

Will not save the pictures of the ships #51

Closed RossSmyth closed 6 years ago

RossSmyth commented 7 years ago

In browser the ships render perfectly, but when I save it the ships aren't rendered. The first time I used the program it worked perfectly, but now this happens no matter how many ships I use or what colors I uses. (Firefox, haven't tried different browsers)

RossSmyth commented 7 years ago

I tried another browser (Edge) and the same thing happened. I used it once perfectly, then the all timess afterwards did work. Also on Edge the custom colors didn't render either. 😕

Raylehnhoff commented 7 years ago

I'll investigate once I'm back home. I'm with my wife's family for the weekend.

On Fri, Nov 25, 2016, 12:18 AM treefroog notifications@github.com wrote:

I tried another browser (Edge) and the same thing happened. I used it once perfectly, then the all timess afterwards did work. Also on Edge the custom colors didn't render either. 😕

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Raylehnhoff/SCFSD/issues/51#issuecomment-262888075, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAvMx-0Seig6YD5B1qiNCPtADxpTLQ-ks5rBn24gaJpZM4K8InR .

RommelTJ commented 7 years ago

I am able to replicate the issue.

When I add ships on the demo site: http://imgur.com/fmDj5e4 After I click download and open the file: http://imgur.com/gLUprhK

Seems like sometimes ships get drawn, but most of the times they do not.

In the console, I get:

XML Parsing Error: mismatched tag. Expected: </input>.
Location: 
Line Number 1, Column 15:

My guess is that you have a mismatched tag somewhere and when you call SCFSDVM.js to generate the image, your parser is probably dropping something.

Raylehnhoff commented 7 years ago

Thanks for investigating. I'll be home tomorrow and will look into it.

What's weird is that the parsing code nor the markup has changed in months, so it's strange this is coming forward only now.

On Fri, Nov 25, 2016, 10:39 AM Rommel Rico notifications@github.com wrote:

I am able to replicate the issue.

When I add ships on the demo site: http://imgur.com/fmDj5e4 After I click download and open the file: http://imgur.com/gLUprhK

Seems like sometimes ships get drawn, but most of the times they do not.

In the console, I get:

XML Parsing Error: mismatched tag. Expected: . Location: Line Number 1, Column 15:

My guess is that you have a mismatched tag somewhere and when you call SCFSDVM.js to generate the image, your parser is probably dropping something.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Raylehnhoff/SCFSD/issues/51#issuecomment-262993628, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAvM91MEIdCZG5eJ_OxVpzqanBpwOyWks5rBw9FgaJpZM4K8InR .

RommelTJ commented 7 years ago

Indeed. I tried to be more helpful by looking at recent commits and seeing what changed, but I could not figure out anything wrong. Sorry I couldn't be more helpful, but in this Thanksgiving, I am thankful for SCFSD. 💯

Raylehnhoff commented 7 years ago

As far as I can tell, this is happening due to Edge falling into the backwards-compatibility rendering code for IE <10.

I'm going to remove that feature entirely, since modern versions of IE (10,11,edge) all support the same rendering method as Chrome, and it seems to make this work properly. Per my analytics, we've not had IE <11 users (except for some poor soul using IE7) in the last month so I feel safe removing that shim.

I also bumped the versions of the third party libraries to their most current.

This will also fix #50

RossSmyth commented 7 years ago

This happened in Firefox and Edge, not just Edge BTW. I'll check it now though

Raylehnhoff commented 7 years ago

I'll check out firefox. There seem to be several issues with it, and I haven't used firefox in years. I'll reopen this issue for that work.

RossSmyth commented 7 years ago

This issue has not been solved. I was able to use the tool once, and then it didn't work after that.

This is what it rendered

And this is what is should've looked like (without the custom color)

RommelTJ commented 7 years ago

I got the same results as @treefroog on FirefoxDeveloperEdition 52.0a2 (2016-11-27) (32-bit) on Windows 10. The first time I tried it, it worked fine with about 7 ships. Subsequent times I did it, I got results similar to what is said above.

vvzar commented 7 years ago

May be it is browser cache issue? Is any way to force clean cache by code?

Raylehnhoff commented 7 years ago

I've confirmed it to be an issue with the third-party library Html2Canvas that this tool uses. I'm investigating a workaround or a fix for it. I'm testing strictly in Firefox and I'm able to reproduce the issues you all called out.

Raylehnhoff commented 7 years ago

For the curious, the reason it's sometimes working in Firefox:

  1. @Loganbacca and I made the decision to swap the tool to strictly render with SVG. We shimmed this feature in in sort of a hacky manner, but moving forward from V2 of this tool all new ships would be in SVG.
  2. When the tool initially loads, it'll attempt to render an HTML image from one of our sprites: https://github.com/Raylehnhoff/SCFSD/tree/gh-pages/content/images. After the initial render it iterates over the images and loads the SVGs into cache and then replaces the images with SVGs (which produces nicer graphics as well as letting you change the color of the ships dynamically)
  3. The current rendering that's working seems to be using ships explicitly on this sprite. Newer ships aren't on the sprite sheet, ergo they don't render

I'm investigating what's going on and seeing if there's a work-around. This and #50 are the first I've heard of any incompatibilities with our rendering methods and Firefox, It's a shitty work-around, but for the time being if you need one of these rendered, I'd suggest using IE/Chrome until I get this sorted.

Raylehnhoff commented 7 years ago

I'm getting closer. I have it rendering locally in Firefox. I'm dealing with an issue where it's cutting off part of the poster. It seems to be size related, as rendering without the Hull D/E it seems to work. I'll keep working on it.

Raylehnhoff commented 7 years ago

Just an update, but I haven't abandoned you all. The bug is super hard to nail down because it's an issue specifically with the library and Firefox's rendering. There are some workarounds, but I've been swamped with some of my other apps that I'm supporting and haven't had the chance to bang it out.

RossSmyth commented 6 years ago

Still not fixed, when I try to save a fleet view the tool just outputs this: What is outputted

Raylehnhoff commented 6 years ago

Unfortunately this is a bug with Firefox, and even though a lot of time has passed neither Firefox nor the Html2Canvas plugin have fixed it.

Since there's nothing I can do about this, the only thing I can suggest is to use Chrome as a work-around. It's not ideal, but the matter is completely out of my hands, and even with the newest version of the plugin the problem persists.

Closing as will not/cannot fix.