★ wanayoo — archive 1999 https://github.com/ionic-team/ionic-cli/issues/3762Nouvelle recherche | Portail wanayoo
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

Local Resource Generation #3762

Closed
imhoffd opened this issue Nov 27, 2018 · 10 comments
Closed

Local Resource Generation #3762

imhoffd opened this issue Nov 27, 2018 · 10 comments

Comments

@imhoffd
Copy link
Contributor

@imhoffd imhoffd commented Nov 27, 2018 •

It would be nice to investigate a local solution to the resources generation, instead of using the legacy resources server and requiring a login.

Issues this might solve or be solved with this:

  • #2331 (online generation requires login, offline wouldn't)
  • #2132 (Android adaptive icons)
  • #3672 (PWA icons)
  • #2679 (differentiation between landscape/portrait splashes)
  • #3851 (option to remove alpha channel)
  • #2924, #3540, #3849 (connectivity, streaming issues)
@harshzalavadiya
Copy link

@harshzalavadiya harshzalavadiya commented Jan 23, 2019 •

I guess ionic resources was built as an service because image resizing with nodejs will require third party libraries and will add too much overhead to actual framework

And most off libs are not very well suited for cross platform

Long ago when I was working on proxied environment I wrote an small utility on weekends using golang that allows to generate resources offline and is lightweight no dependency an wrapper can be easily wrote around it if we want to ship as npm and can download binaries according to OS.

Maybe worth making and less time consuming if folks at ionic are interested

PoC https://github.com/harshzalavadiya/ionic-resource-generator

Edit: Jimp looks more promising

@imhoffd
Copy link
Contributor Author

@imhoffd imhoffd commented Jan 23, 2019

@harshzalavadiya (and others) CLI 4.9.0 just shipped with a hidden option to try a local resources generation tool.

Try this:

npm i -g cordova-res
ionic cordova resources --cordova-res
@harshzalavadiya
Copy link

@harshzalavadiya harshzalavadiya commented Jan 23, 2019 •

That's really cool 😎, thanks

Btw, repo link on npm is giving 404 isn't it open source

@imhoffd
Copy link
Contributor Author

@imhoffd imhoffd commented Jan 23, 2019 •

@harshzalavadiya Thanks, I just had to make it public.

https://github.com/ionic-team/cordova-res

@trumbitta
Copy link

@trumbitta trumbitta commented Feb 1, 2019

@dwieeb this needs to be the new default :D

@imhoffd
Copy link
Contributor Author

@imhoffd imhoffd commented Feb 1, 2019

@trumbitta Thanks! Glad you like it. I'll be rolling it out to more people as I get more feedback.

@rodrigograca31
Copy link

@rodrigograca31 rodrigograca31 commented Apr 10, 2019 •

I got something to add:
Currently the resource processing happens on an ionic server and first uploads a "non valid" image to then say its too big.... What a waste, at least check that it has a reasonable size before proceeding...

{"Error":"image too large: 29906794","Width":0,"Height":0,"Type":"","Vector":false⠴ Uploading source

It uploaded my almost 30MB png splashscreen to then say its too big....
Yeah now I know its too big and have fixed it (was exporting with no compression at all, my bad)
Probably the same with the icon resource....

This is wasting so much bandwidth..... not a problem for me but ionic servers could save so much bandwidth!

@imhoffd
Copy link
Contributor Author

@imhoffd imhoffd commented Apr 10, 2019 •

@rodrigograca31 Thanks, but that won't even be a consideration for local resource generation. It won't need to upload.

@rodrigograca31
Copy link

@rodrigograca31 rodrigograca31 commented Apr 10, 2019

@dwieeb Yeah, was just mentioning it while they stay with non local resource generation.

@imhoffd
Copy link
Contributor Author

@imhoffd imhoffd commented May 29, 2019

Ionic CLI 5 ships with support for generating Cordova resources locally using the cordova-res utility, which completely replaces the existing code for generating resources remotely in ionic cordova resources.

Give it a try! Leave feedback/bug reports in either repo. Thanks!

@imhoffd imhoffd closed this May 29, 2019
Tooling 🔧 automation moved this from Backlog 🤖 to Done 🎉 May 29, 2019
@ionic-team ionic-team locked and limited conversation to collaborators May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Tooling 🔧
  
Done 🎉
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants