Ionic splash screen (error: unable to read uploaded image)

狂风中的少年 提交于 2020-01-03 08:43:52

问题


I am trying to use the ionic resources --splash command, I have a splash.png file saved in my resources folder as well as in the root of my ios and android folders, and it is 2208 x 2208 which is the advised size. But when I run the command I get the following error

"Invalid upload: unable to read uploaded image"

I have added the splash screen preference in my config.xml. Is there more conditions that they didn't specify?


回答1:


I got the same error when uploading an interlaced .png.

However after re-exporting with interlacing turned off ionic accepted the file fine.




回答2:


I just realized that the image I had was actually an Adobe Illustrator image. All I had to do was rename the image from .png to .ai and it worked!

For those wondering here is a quick explanation on the difference between the two:

.ai - Adobe Illustrator vector files are scalable both down and up.

.png - pixel files can be scaled down, not up.




回答3:


Do not try to save your original jpeg image into png by changing the name of it. You have to use png image. For instance, I save my jpeg images into the ionic folder, and change the type of the jpeg file by changing .jepg to .png. However, it doesn't make a real png image. You have to use software to do the type transferring or download the png image.




回答4:


I had it working in Windows 7 by storing the icon and splash files as psd.




回答5:


Here is what I was doing wrong:

1 - Renaming a .jpg to .png and hope it works, it didn't. You need to use a .png image.

2 - Using an image with incorrect resolution, most articles mention that it has to be 2208*2208, I kept getting errors for an incorrectly sized image. Using a 2732 * 2732 resolution image worked like a charm.



来源:https://stackoverflow.com/questions/29013825/ionic-splash-screen-error-unable-to-read-uploaded-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!