Nativescript-angular: Issue with image urls

Created on 19 Sep 2020  路  11Comments  路  Source: NativeScript/nativescript-angular

Environment
https://play.nativescript.org/?template=play-ng&id=GYAGpS&v=379

Describe the bug
Local images work fine but when change to placeholder.com images(https://via.placeholder.com/150.jpg) or any other online image URLs, it throws an error.

Works with this URL

https://nativescript.org/assets/ns-logo_share_600x315.png

but not with the following or any other. How will I be able to set images from my server?

https://via.placeholder.com/150.jpg

Expected behavior

Sample project
https://play.nativescript.org/?template=play-ng&id=GYAGpS&v=379

Additional context
Tried in multiple phones too and the emulator

Device Logs:

JS: Error in downloadBitmap - java.io.FileNotFoundException: https://via.placeholder.com/150.jpg

All 11 comments

hey its working fine but your link is not a valid image link its a webpage link

image

other images are working fine

Screenshot_20200930-095853

Any image that you will open in the browser will look likes this:
image

image

Additionally adding response headers too for comparing:
image

image

For png/jpg concerns :
image

But I don't see any difference between those links. I don't understand what you are pointing at?

Sir i meant that your link is not valid image
try this

_in your use_

  • https://via.placeholder.com/150 (showing in web browser)
  • same result when changing extension (https://via.placeholder.com/150.nukrt) (https://via.placeholder.com/150.jpg) etc

that means its not a proper bit image

You must give a proper file(image) link.

image can be extension of _.png .jpg_ etc or maybe _without extension_ but link must be of an image not other file

You must give a proper file(image) link.

image can be extension of _.png .jpg_ etc or maybe _without extension_ but link must be of an image not other file

Checked the link on various sites (if it is a valid image link or not).
https://exifinfo.org/detail/x_SzPFOjuAM0wkcPhzyBGQ

It is still not convincing. This irregularity gives me little to no confidence that it can work properly all the time. _1 link like that and the app goes weird._

Can you provide any code or something to track if that link is valid or not? This will be more helpful because all the sites or codes I try to check if the above link is a valid image link or not, I am not getting the result that you are too convinced to say.

Sir i meant that your link is not valid image
try this

_in your use_

  • https://via.placeholder.com/150 (showing in web browser)
  • same result when changing extension (https://via.placeholder.com/150.nukrt) (https://via.placeholder.com/150.jpg) etc

that means its not a proper bit image

Well, we can configure to serve images irrespective of the extension as we do with .php or .html files.
there are many websites that actually do this too.
https://www.printvenue.com/static/polo-tshirt-banner-2019

Not a good point to go by.

As I said, it will be better if any code can check the validity of the link which can give the result that you are stating, will be helpful as I tried but getting just the opposite of what you are stating.

i never said extension is required, the proper valid image link is required
here its a image without extension https://www.printvenue.com/static/polo-tshirt-banner-2019
try adding extension will cause not found https://www.printvenue.com/static/polo-tshirt-banner-2019.png

but in your link add anything, its return a page, in case if it is a file then you can only able to access through that specific file url

i never said extension is required, the proper valid image link is required
here its a image without extension https://www.printvenue.com/static/polo-tshirt-banner-2019
try adding extension will cause not found https://www.printvenue.com/static/polo-tshirt-banner-2019.png

but in your link add anything, its return a page, in case if it is a file then you can only able to access through that specific file url

Like I said earlier, we can configure our server to return image irrespectiveof the extension. Calling it an invalid image link is not right as you are getting served by an image all the time.

So unless you can provide some code that can tell that the specified link is not serving a valid image, this point can be nothing more than spam. As this is not serving any valid or logical point as the served item is an image.

but in your link add anything, its return a page, in case if it is a file then you can only able to access through that specific file URL

If you open an image on browser.. you will see it as page lol :/ Check the content-type.. it is an image, not a page lol

It would be better to provide some code otherwise all are just baseless points. And we can't move forward without that.

i never said extension is required, the proper valid image link is required
here its a image without extension https://www.printvenue.com/static/polo-tshirt-banner-2019
try adding extension will cause not found https://www.printvenue.com/static/polo-tshirt-banner-2019.png

but in your link add anything, its return a page, in case if it is a file then you can only able to access through that specific file url

Any workable code for testing as discussed above? I can not move forward without that.

See a live wallpaper app using nativescript

https://play.google.com/store/apps/details?id=org.iamabs.lyrica

See a live wallpaper app using nativescript

https://play.google.com/store/apps/details?id=org.iamabs.lyrica

not helping with my above-described problem. Can you provide any code to justify your hypothesis?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tsonevn picture tsonevn  路  3Comments

EricRobertBrewer picture EricRobertBrewer  路  3Comments

sarvagayatri picture sarvagayatri  路  3Comments

NathanWalker picture NathanWalker  路  3Comments

vakrilov picture vakrilov  路  3Comments