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

Issue with image urls #2255

Open
Skillnter opened this issue Sep 19, 2020 · 11 comments
Open

Issue with image urls #2255

Skillnter opened this issue Sep 19, 2020 · 11 comments

Comments

@Skillnter
Copy link

Skillnter commented Sep 19, 2020

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:

[Galaxy Note10+]: Error in downloadBitmap - java.io.FileNotFoundException: https://via.placeholder.com/150.jpg

[Galaxy Note8]: Error in downloadBitmap - java.io.FileNotFoundException: https://via.placeholder.com/150.jpg

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

@iamabs2001
Copy link

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

@Skillnter
Copy link
Author

Skillnter commented Sep 30, 2020

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 :
[Galaxy Note10+]: Error in downloadBitmap - java.io.FileNotFoundException: https://via.placeholder.com/150.png

image

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

@iamabs2001
Copy link

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

in your use

that means its not a proper bit image

@iamabs2001
Copy link

iamabs2001 commented Sep 30, 2020

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

@Skillnter
Copy link
Author

Skillnter commented Sep 30, 2020

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.

@Skillnter
Copy link
Author

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

in your use

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.

@iamabs2001
Copy link

iamabs2001 commented Oct 1, 2020

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

@Skillnter
Copy link
Author

Skillnter commented Oct 2, 2020

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.

@Skillnter
Copy link
Author

Skillnter commented Oct 9, 2020

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.

@iamabs2001
Copy link

See a live wallpaper app using nativescript

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

@Skillnter
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants