I’m getting an error like below when I run the command - ionic cordova resources --icon or --splash:
Uploading source images to prepare for transformations - failed!
HTTP Error 400: POST https://res.ionic.io/api/v1/upload
(“Error”:“unable to read uploaded image”,“Width”:0,“Height”:0,“Type”:“png”,“Vector”:false)
This error is rising only for some images with different dimensions. Even I used better dimensions than mentioned, it is working. But for some dimensions which are not suitable as mentioned…it is not working…Please help me out of this.
Thank You
Yes…Actually we have default icon with 1024 * 1024 right? So I kept another icon.png with dimensions:949 * 596. Then it is working. And when I changed to another icon.png with dimensions:2500 * 2500… Then it is showing the error which I have mentioned. And ionic info is below:
global packages: @ionic/cli-utils:1.5.0
Cordova CLI :7.0.1
Ionic CLI :3.5.0
I wanted to change the default icon. So I tried with different files. Some of them are only working. Remaining are showing error. So can u please help me what the error is?
My guess from reading the error message: It can’t open/read the image you were trying to use when you got the error. I doesn’t recognize the width and height of the image.
Yes…it is unable to recognize width and height as u guessed. But what might be the reason to accept some file? For splash screen (splash.png) also it is showing same error. Bt it works well for the default splash.png which is of 2732 * 2732 dimensions. I tried that too… Bt same error arising. Let me know the error and solution too…
Thank you
When I used icon, it is working. Instead of icon I replaced icon.png with splash.png(renamed to icon.png)…then not working and also I tried splash for splash screen(splash.png) and now also it is showing error like I mentioned @Sujan12
It also works for Android if you put the image in the correct sizes. Just renaming splash to icon won’t work, you also have to change the image dimensions of course.
Thank you sooo much @Sujan12. I’m getting everything(Icon and Splash screen) after changing them to the default dimensions as icon(1024 * 1024) and splash(2732 * 2732).
Yes…may be it not about dimensions as I experienced just now. Because whenever i’m changin them to the size of 1024 * 1024 or 2732 * 2732, Some of them are only working. Anyways thank you soo much.
I am getting this error too. Looks like the error is in the splash.png file. I can run the command against the icon with:
ionic cordova resources -i
but gets an error with splash command:
ionic cordova resources -s
× Uploading source images to prepare for transformations - failed! HTTP Error 400: POST https://res.ionic.io/api/v1/upload {"Error":"unable to read uploaded image","Width":0,"Height":0,"Type":"png","Vector":false}