Manifest does not contain a suitable icon - arrays

I am using the code mention below for the icon of the web app
{
"src":"image/logo.png",
"sizes":"512x512",
"type":"image/png",
"purpose":"any"
}
]
but in chrome I am getting the error:
Manifest does not contain a suitable icon.....
Why is it happening and how can I solve it..?
Hope for help soon.
Thanks In Advance.

You need at least one PNG file of 144x144. But honestly you need a about 100 to satisfy all the possible use cases.
That is one reason why I create PWA Starter. It generates your manifest file, icons, starter service worker and has some resources too.
You might have an image that has some corrupt bits or it might now have the right Content-Type header being served, etc.

Related

Webpack dev server refresh loop madness

I've been using my own hand-rolled solution (outside of Webpack) for taking a folder of SVG files, extracting out the contents between <svg></svg>, building a JSON file, and then using that to inject into a React component so I can output specific icons with more control over the surrounding attributes.
I came across https://github.com/gilesa/svg-to-json-webpack-plugin which actually does a lot of the same for me, which is awesome! Something odd happened though when attempting to use it with create-react-app and what I suspect is the Webpack dev server. Whenever I attempt to import the generated .json file, the dev server continually refreshes in the browser.
I go into detail a bit more in the issue I created https://github.com/gilesa/svg-to-json-webpack-plugin/issues/1 but my attempts at debugging exactly what's causing the infinite loop haven't been successful. The Webpack plugin API is pretty great, so I've learned a bit along the way, but no dice thusfar.
Ideally, I'd want Webpack to ignore that specific file if that is what's causing the watcher to kick-off again. Potentially because it's creating a file in the same src directory it is looking for changes to? Thanks for any help in the right direction!
this sounds like a known issuse of #25, try this webpack plugin webpack-mild-compile, it should works.

Loading local images in Codename One Project

I've got a database, and each entity has a certain number of photographs.
I want to load these images in a component, and form what I've found I can in a Multi-List. I'm having problems as I don't know how to do this.
The database currently hold the paths of the images, which I have placed in a folder next to my src.
I know I should be pasting here what I have tried, but nothing I have tried has been successful in the least.
Any help would be greatly appreciated.
Many thanks,
Ari.

How do I load an alternative font for PIL ImageFont on App Engine?

I have successfully ported some Python code to App Engine that uses PIL's ImageFont and ImageDraw to generate a dynamic image. The only remaining problem is that the original code loads a TrueType font using a call like this:
titlefont = ImageFont.truetype("Verdana Bold.ttf", titlefontsize)
I can't just upload the font file and access it directly in GAE (at least I don't think I can?!). I guess it might be possible somehow to dump font data in a datastore blob, load that and feed it into PIL, but this seems less than elegant, and quite wasteful if everybody who uses PIL for image generation does the same thing. Currently I'm stuck with ImageFont.load_default() though, which gives pretty horrendous looking results.
Is there some clever way of working with alternative fonts in GAE PIL? Some additional API I'm missing that will return usable font objects?
Any file in your applications directory will be uploaded along with your application when you deploy it.
So yes, you should be able to "just" access any file you need by keeping it in or under your application directory, moving it there if necessary.
If you want to serve those files, that's something different. https://developers.google.com/appengine/docs/python/gettingstarted/staticfiles
But try including your .ttf file where your app can locate it and it should just work.

CMSMS File Download Problems

I'm using the CMS Made Simple platform; which I'm not very familiar with!
The site has a secure frontend, which contains a document library for members. Files are stored outside the document root and links are generated by the CMS so you should only be able to get the documents if you're logged in.
At first glance the setup works fine; however certain PDFs uploaded in this fashion are corrupt upon download, and line endings in text files aren't preserved.
Sorry if this is a bit vague, I'm hoping someone has come across a similar problem but any ideas would be greatly appreciated.
Regards,
Rich
You should check which module/tag is handling the download / upload.
Are you sure they´re intact when uploaded?
Check for headers, and content size calculation, try different browsers and different methods to force the download.

What are your recommendations for reducing the number of resources (JavaScript and CSS) that DotNetNuke loads?

The home page for DotNetNuke 5.2 is around 252.6KB. It uses 15 JavaScripts and 8 CSS files. The number of resources DotNetNuke uses seems excessive to me. I am looking for best practices creating DotNetNuke skins that limit the JavaScript and CSS resources.
You can use the Unload CSS Skin Object to remove links to some of the CSS files loaded by the framework (like Default.css, portal.css & any module-specific CSS files). You can then move all of those styles into the skin (or portal stylesheet, whichever is your preference), so that there's only one stylesheet that gets loaded.
I don't know of any solutions for combining JavaScript resources or reducing the number of scripts that DNN requires.
From 6.1 onward, the Client Resource Management component is the solution for this. It automatically combines all your files, cleaning them up, removing comments, and minifying if desired.
http://www.dotnetnuke.com/Resources/Wiki/Page/Client-Resource-Management-API.aspx
It takes a little getting used to, but the control is quite nice. You can decide which order they'll go in, you can group the files in bunches if you don't want one big single file - maybe you want certain bunches of scripts together but not all.
One thing to remember is that when you're doing development (as noted by the comment below, which I've since edited this post), you should always use debug=true in the web.config, otherwise if you are using Resource Mgmt and change your source files, you'll constantly need to regenerate the combined files by going into Site Settings, Client Resource Management, and increment the version. It's kind of a protection to keep anything from altering your clients' browser caches without intent (that's the message box that pops up to let you know when you do it). I'm sure if you have a zillion users this might make a difference.
Part of that is just the dynamic nature of DNN - there are some good resources that R2i has published about combining javascript and CSS
One concrete suggestion is to combine all your skin and contianer css in one file and if you have full control of the site to combine the css from the modules you use into that same file.
I know with the addition of the Telerik controls there is some abilities to combine resource files
Another thing that helps is to combine graphics into a single file and use CSS (the sprite technique) to cut down number of files loaded and calls to the sever
Like it was stated above, it's the nature of the beast. Each module will have at least 1 css file included. You can check out PageBlaster from snapsis.com, I believe it will do what you are looking for.

Resources