Images don't work on server Play Framework - html

I'm having a problem with images in Play.
This is the way I access the image
src="#routes.Assets.at("/images/logo-mobile-control-white.png/")"
It works when I access from local (localhost:9000), but when I access from another computer (http://10.253.3.243:9000) the images don't work.
Here is the code from the local
img src="/assets//images/logo-mobile-control-white.png/" width="180" height="60" border="0" title="Mobile
Control" alt="Logo Mobile
Control"
And Here is the code from the server
img src="/assets//images/logo-mobile-control-white.png/" width="180" height="60" border="0" title="Mobile Control" alt="Logo Mobile Control"
Just the same
Help me please!

simply use this
src="#routes.Assets.at("images/logo-mobile-control-white.png")"
This will produce the following result:
<image src="/assets/images/logo-mobile-control-white.png"/>

Related

Local image doesn't work on markdown with <img

I'm trying to use markdown to generate a documentation. When i use <img alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" src='http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg'/> it's working and it shows the image but when i put <img alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" src='test.jpg'/> doesn't work although the image test.jpg is on the same folder with the mardown file.
I want to use <img because i want to align my image to the center !
The first one
<img alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" src='http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg' />
works because the image source is from img.youtube.com
The second one
<img alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" src='test.jpg'/>
has a local stored image source from your computer. As far as I know it is not only enough to enter the name of the picture but you must also write in your path.
Try something like this (example)
src="C:\Users\YourPCName\Documents\YourSaveFolder\test.jpg
Please note that you have to change the path accordingly when uploading to a webspace/server in general.
Let me know if it works!
Cheers,
Kevin

Can view pic in URL - but shows broken when displaying?

I am trying to insert an image on my site.
http://canarywharfian.co.uk/pages/kkkk/
As you can see it's showing as broken. However, when you click on it, it loads. I am confused why does it not show, if its loads if you click on it?
<a href="http://www.canarywharfian.co.uk/sample-2.jpg">
<img src="http://www.canarywharfian.co.uk/thumb2_trading.jpg border="0" class="firstimgbord" height="162" width="90"></a>
You forgot a closing " in your image src tag:
<img src="http://www.canarywharfian.co.uk/thumb2_trading.jpg" border="0" class="firstimgbord" height="162" width="90"></a>
^

iOS UIWebView force image size objective c Xcode

I have an incoming HTML that contains img tags.
I need to force the images to be max the size of the viewport: iPhone or iPad.
Currently the text fits the screen nicely, but the images overflow the screen size.
I can force to [_wvContent setScalesPageToFit:YES];, but then the text is too small.
Any way to make the images the screen size?
Couple of incoming examples:
<img alt="Comparison " src="http://www.sample.com/wp-content/uploads/wp-post-thumbnail/dsa_k4iI.jpg" class="wppt_float_left" title="Comparison Photo" />
<img class="alignnone size-full wp-image-107864" alt="320d Comparison " src="http://www.sample.com/wp-content/uploads/590px4_2526_RT.jpg" width="590" height="329" title="20d Comparison" />
<img alt="" src="http://www.sample.com/wp-content/uploads/wp-post-thumbnail/dsa_ka.jpg" class="wppt_float_left" title="2013 BMW 320i: Track Tested by Edmunds Photo" />
<img class="alignnone size-medium wp-image-107859" alt="" src="http://www.sample.com/wp-content/uploads/201_-655x436.jpg" width="655" height="436" title="" />
Thanks for your help.
What you need to do is construct an objective-c string containing javascript that will run inside the webview to change the image sizes to fit inside the bounds CGRect of the web view. Then tell the web view to execute this javascript by calling stringByEvaluatingJavaScriptFromString:

image hyperlink not working in WordPress text widget header

I located social icons in my text widget located in the header. It works in IE but not in Chrome or Firefox?? I am wondering if it has to do with my Artisteer 4 theme I am using, but I have looked at all the CSS and code and don't see what is interfering. My site is http://www.visualtechnologyconsulting.com
and the code in the text widget is:
<a href="http://www.facebook.com/visualtechnologyconsulting/">
<img class="alignnone size-full wp-image-372" alt="Visual Technology Consulting
Facebook" src="http://www.visualtechnologyconsulting.com/wp-
content/uploads/2013/01/facebook-logo-webtreats.png" width="75" height="75" />
</a>
<a href="http://www.linkedin.com/company/visual-technology-consulting/">
<img src="http://www.visualtechnologyconsulting.com/
wp-content/uploads/2013/01/linkedin-logo-webtreats.png"
alt="Visual Technology Consulting Linkedin" width="75" height="75"
class="alignnone size-full wp-image-373" />
</a>
I can see them in Chrome. Everything looks fine.
But maybe you post the CSS Part?
Nate, its working for me in Chrome and firefox. See here. Have you refreshed your browsers cache?
I found it!! it was a CSS issue I was covering the icons with the header div, needed to reduce it to 40%!!!
Thanks everyone!

How to link an image and target a new window

I have a picture, if I click onto that picture, how can I build an image reference so another page opens in a new tab or a new window of my browser displaying the picture?
<a href="http://www.google.com" target="_blank">
<img width="220" height="250" border="0" align="center" src=""/>
</a>
If you use script to navigate to the page, use the open method with the target _blank to open a new window / tab:
<img src="..." alt="..." onclick="window.open('anotherpage.html', '_blank');" />
However, if you want search engines to find the page, you should just wrap the image in a regular link instead.
<a href="http://www.google.com" target="_blank"> //gives blank window
<img width="220" height="250" border="0" align="center" src=""/> // show image into new window
</a>
See the code
Assuming you want to show an Image thumbnail which is 50x50 pixels and link to the the actual image you can do
Of course it's best to give that link a class or id and put it in your css
you can do like this
W3C Home Page
find this page
http://www.corelangs.com/html/links/new-window.html
goreb
To open in a new tab use:
target = "_blank"
To open in the same tab use:
target = "_self"
Try this simple solution
<a href="path/of/your/image/image.png" target="_blank">
<img src="path/of/your/image/image.png" alt=""
style="width: 37rem;max-width: 100%;height: auto;vertical-align:
middle;border-style: none;">
</a>
See live https://codepen.io/awaisaslampro/pen/abwOPrP
If the question is about to click on Image and open in New Tab like this
Here is the code:
<a href="assets/images/android-chrome-512x512.png" target="_blank">
<img width="220" height="250" border="0" align="center" src="assets/images/android-chrome-512x512.png" alt=""/>
</a>
Both the href and and src attributes values/URL's can be local for testing and incase of live site.. it should be live link to access