How to load gif image in ionic app - Android/IOS - angularjs

Am facing a issue with ionic. here, how to load gif image in <image src="icon.gif"> in a html page.
its working in browser but not in mobile or device.
can any one help me.

You only need to put the following HTML tag with the complete URL of your GIF image:
<img ng-src="{{yourGifURL}}" alt="Description" />

Make sure you using the file name as case sensitive like 'loading.gif' or 'Loading.gif'.
And also use the <img src="">
I was having a similar issue.

Related

How to use an image in react imported from localhost

So i'm working on a react project and i want to use an image which is stored in my computer
i made the following code
<img src='my_image.png'/>
however it doesn't show in the browser as shown below
see image
upload your images in your public folder then access it
eg:public/images/p1.png
<img src='images/p1.png'/>
https://codesandbox.io/embed/amazing-bouman-x3mnr?fontsize=14&hidenavigation=1&theme=dark

NextJs Image does not show on Safari

I am using NextJs for my website. Here is the code I'm using for showing Images
<Image
src={`/p1.png`}
layout={"fill"}
objectFit="contain"
objectPosition="center"
alt={"publication image"}
/>
This image is visible on all browsers except Safari. How can I make it visible on Safari as well? Thanks in advance
I got the issue fixed. The image container did not have position set as relative

How to integrate AMP (Accelerated Mobile Pages) on your existing REACT website?

I'm currently working on a PWA app which is written in React.js and I'm using VScode editor. I have read the AMP docs in which it is written that replace your HTML media tags with AMP equivalent AMP media tags. But when I'm replacing <img src="" alt="" /> with <amp-img src="" alt="" ></amp-img>, my vscode editor is auto correcting it to <amp-img src="" alt="" /> which is resulting in
status: AMP Validation FAILED
and in web-view, my images are not visible due to this issue.
Please help.
In addition to #Bachcha Singh's comment, you may want to check this link to validate AMP pages. Also, you can't just convert your site into an AMP just by replacing few tags. Your site must follow AMP HTML specification. Check this thread. You may also check this tutorial on how to combine AMP and PWA.

Angular JS using Grunt: Display images from local folder using relative path from JSON

So I am using a JSON that returns a lot of data about the user including pictures. The problem I am facing is that I believe the relative path to the images folder is correct however for some reason it is saying in ng-source="relativePath" instead of the image. The only conclusion I can come to is either the path is wrong or there is some sort of import I must do for the images to be used in the project.
<div ng-repeat="results in userInfo.images">
<figure class="img">
<img data-ng-source="{{results.imageUrl}}" ng-alt="{{results.name}}" ng-title="{{results.name}}" />
</figure>
</div>
I have tried source, ng-source, and data-ng-source. When I view in console and on the html for image src it shows the relative path /images/profilePicture.png.
My project has the following structure:
Repositry Name
app
css
home
home.module.js
home.tpl.html
images
profilePicture.png
js
resources
app.js
index.html
Using best practices the index.htlm is the container for the single page application. We are using the home.tpl.html page that is injected into the index.html container page.
I have tried switching the path to go directly from index.html -> /images/profilePicture.png as well as from home.tpl.html -> ../images/profilePicture.png.
I could not find any posts relevant to my situation but I believe perhaps you need an app.use or some sort of injection method to add the folder of images to be able to be used?
Note: I am not sure if this is helpful however when I run grunt build instead of serve I check the dist folder and the image folder does in fact have all of the images.
Change your <img data-ng-source declaration to just use ng-src:
<img ng-src="{{results.imageUrl}}" ng-alt="{{results.name}}" ng-title="{{results.name}}" />
More details at w3schools: ng-src

Images are not displaying from specific URL's in windows app

I have developed Hybrid app using Ionic(Angular) and trying to display image in image tag, folllowing is the code.
<ion-content>
<img ng-src="{{product.ProductMediaItems[0].MediaSrcURL}}" Width="100%">
</ion-content>
In dom element image tag looks following -
<img src="https://modpizza.com/wp-content/uploads/2013/10/whats-your-mod.png" Width="100%">
Issue -
Image is not displaying in windows app, while it is working in Android and IOS.
If I try to change the image url and to some other website image path after inspecting the app in visual studio image is loading fine.
Not sure it is a issue with particular website "https://modpizza.com/" or Ionic with windows app.

Resources