Application Resources Not Working as Image Source? - nativescript

I have a very basic layout which includes a spot for an image:
<Image src="{{ cIconSrc }}" />
At first I uploaded an image to the ./resources folder and set the source of the image as:
"~/resources/chrome_icon.png"
...which worked great. Then I read that the correct way to do it is to create several variations of the image and place them within the App_Resources folder structure for both Android and IOS. I've done that, but when I try to switch my code so that it sets the source of the image using:
res://chrome_icon
...it is not working. I don't see the image shown on the page at all. Can someone please tell me what I'm missing? Here are a few screenshots so that you can see that I put the icon variants where they should go:
Android folders
IOS screenshot

Related

How to Host Images for JavaScript/React App

This is a code snippet from my .js project, which is being used in another .js, html & css file:
projects: [
{
image: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Google_Assistant_logo.svg/1200px-Google_Assistant_logo.svg.png",
},
{
image: "https://drive.google.com/file/d/17HUtCYyVrcnSHQrAEchacigQ5lInkocL/view?usp=sharing",
}
]
The image on the first links works but the second (Google Drive) doesn't. There is no image shown for that link. I also tried a couple of image hosting websites but nothing seems to work. How can I get a correct link for other images? Is there any other place I can save my image except Google Drive?
Upload your picture to Google Drive and change the settings of your picture to public.
Get its shareable link.
Go to this website and generate a direct download link.
Worked for me!

Images not showing in codepen

I have a code which I need to share so I pasted in from Visual Studio Code into code pen and replace all my image links with imgur links but when I save the code on codepen it doesn't show up.
I've tried uploading to different picture sharing websites but none of them seems to work or sometimes they just dissapear
<img src="https://images.app.goo.gl/PH9vzQEL6deb152b7" alt="logo">
This is a simple code i used but the image just refuses to appear.
I just need to image to show up, if there is any way to share my website without publishing it to the web I would like to be informed about it too. Thanks you.
this is a website that get your image and give you base64 of it and you can put this base64 thing in your src attribute of img element and you are good to go

No embedded Image appear in xamarinForm

Iam newbie to XamarinForms and I use visual Studio 2017.
I want to add embeddedImage to my app so to the "imagepage.xaml" file I added:
embeddedImg.Source = ImageSource.FromResource("XFDemo.Images.baby.jpg");
and in "imagepage.xaml.cs" I added:
<Image x:Name="embeddedImg" Aspect="AspectFill" />
but no image appear in the app. just a blank page I can see.
please note that the image exist in PCL project inside "Images" folder and I set the "Action Build" of the image to "Embedded resource".
finally I found the solution ...
thats happened because Iam using xamarin live player and there is some limitations with xamarin live player one of these limitations is embedded resources.
check the following link to see those limitations:
enter link description here

Impossible to reference an image from the Assets Folder

I am currently building a Windows Universal App and the learning curve is OK. I get a response from my webservice, parse the JSON, display info in the app, but my current issue is the following one:
I tried to display an image that I put in the Assets folder, but this doesn't seem to work.
This is my layout:
As you can see, the text "Test" is correctly displayed but not the images.
On the right side, in the explorer pannel, I cannot see the files that should be here:
WHAT I HAVE TRIED:
In my example, they are in the Assets/picto folder, but I have also tried the root directory Assets, as wal as creating Image folder at the same level.
I have definitely no idea how to add a simple picture, so any help is appreciated!
Adding items in Windows explorer to the right location doesn't add them to your solution / deployment.
You have to right-click the picto folder -> Add > -> Add existing item. Your items are not even in your solution, so they won't show up on the layout screen.
Make sure you set the correct build target for each image.
If an image shouldn't show up, even through it's in your solution, this is often the reason.

Website displays image that is not associated with img src

I have an iOS app that contains a UIWebView, which display a webpage. Sometimes the page displays a different image than the one associated with the src link.
A user sent me a screenshot where it was clear that one of the icon images had been replaced with a completely different image. The same wrong image was displayed in each of the instances where this icon was supposed to be displayed. Refreshing did not solve the issue, but closing and opening the app did. (Or maybe she actually deleted and reinstalled the app.)
The html for the icon is just an img:
<img src = "/the_icon_source">
The img src is hardcoded directly into the HTML file. I therefore don't see that the HTML itself could have been wrong or said anything besides "/the_icon_source".
So how can the wrong image be associated with an image src? Could the server be sending the wrong image when it's asked for "/the_icon_source"? Could the iOS app be caching incorrectly, mixing up images? How to test and fix?
I myself cannot reproduce this issue. I'm not sure how often it occurs, but several users have mentioned it, also for other images on the page. They have only mentioned it occurring in the app, not on the website. This may just be because the app is used more than the website.
My host is Webfaction and the images are served using WebFaction server’s static-only front-end nginx process. The app displays the website in a UIWebView. (Webfaction suppprt merely told me that they served the right images.)
Is the problem not that you have it like this:
img src = "/the_icon_source"
rather than like this:
img src = ".the_icon_source"
If this is sat on a linux server the / will be pointing to the root directory whereas the . or simply the_icon_source would simply point to the directory in which the website is sat which i assume is where the image is also located.

Resources