Embed a image to eclipse and display it with scala - scala

I would like to ask how to display an image and how to embed it on eclipse.
after embedding it i am trying to display it as
<img src=("/UbitMvc/riivo.jpg")/>
<img src="/UbitMvc/1.jpg">
<img src="/home/ilgun/play/UbitProject/Resources/1.jpg">
so basically i'm trying every possible way. What i am doing wrong ?

At least for Play! 2.0 and above, yu'll need to add a GET to your /conf/routes file in order to be able to access your images.
GET /assets/*file controllers.Assets.at(path="/public", file)
Also I believe that the standard for Play! applications is to drop all images, javascripts, and stylesheets into their appropriate folder within the /public directory.
ex. /public/images/riivo.jpg
So your img call should end up being
<img src=#routes.Assets.at("/images/riivo.jpg")>

Related

Unable to embed a gif on imgur to a README.md on github

I want to show a large gif on README.md. Firstly, I uploaded it to imgur. And then, I added the url to README.md # <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">. But it cannot be loaded, it was compiled to:
<a href="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" target="_blank">
<img alt="YAP" src="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" data-canonical-src="http://i.imgur.com/dNYswmI.gif" style="max-width:100%;"></a>
This is my README.
###Description
A open source player.
###Screenshot
# <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">
The gif you shared is 19MB in size.
GitHub routes all content through https://camo.githubusercontent.com/ even for external source now. Sharing a file that is bigger than the size limit (10MB) will get you a "Content length exceeded" error.
I tried sharing it on Google Drive, Dropbox, Droplr, my own server all ran into this issue unless the file size is below 5MB. It also doesn't matter if your syntax is in html or markdown.
<img src="https://static01.bbi.io/2Wt9Tk.gif"/>
!(image)[https://static01.bbi.io/2Wt9Tk.gif]
Your solution is to resize your gif. You can do it with service like this one: https://ezgif.com/resize .
GitHub does support Imgur embeds. Make sure to provide the image extension, which isn't on Imgurs default share hyperlink.
BAD
![Imgur Image](http://i.imgur.com/zTONrOD)
GOOD
![Imgur Image](http://i.imgur.com/zTONrOD.jpg)
Imgur also provides this preformatted link under the MarkDown links menu, see image below.
See also an example readme.md with Imgur image.
the way it worked for me was with the tag like #williamli said
<img src="https://static01.bbi.io/2Wt9Tk.gif"/>
You can still have a gif in readme.md that's above 10MB if you include the gif itself in your repository.
This is because images from the repository itself are not routed through
https://camo.githubusercontent.com/.
You could upload the gif to a misc folder and embed it like so:
<img src='./misc/your_file.gif'>
I believe the only way to link images from imgur would be something like this:
![An open source player](http://i.imgur.com/dNYswmI.gif)
However (in my experience) GitHub does not support imgur, I do not know if there are any other supported image share service.
If you can't find a supported service just do something like this as a last resort to just leave a link to the image:
###Description
A open source player.
### Screenshot
#[Screenshot](http://i.imgur.com/dNYswmI.gif)
I've run into this issue as well. Github will not allow you to upload anything over 10Mb. However, they offer an optional large file storage service specifically for audio/video/etc. This is what you want:
lfs-github

HTML5 Ad made with Google webdesigner to Doubleclick for publishers Small Business

How do I publish a HTML5-Ad in Doubleclick for publishers Small Business? Seems like I need to insert click-macros. But were do I insert them if it´s based on script-event?
Generally when you're uploading an HTML5 creative, there are multiple files you are generally dealing with (CSS, JS, images, etc - along with the actual HTML file). The procedure is generally as follows:
1) DFP requires your creative assets (images, scripts, CSS etc) to be uploaded individually (Alternatively, the CSS and Javascript can be added inline into the HTML5 code).
2) The source code of your HTML file must be added to the "Code snippet" area.
3) Next, every file path in your creative code needs to be replaced by DFP file macros, which upon ad serving will be replaced by the absolute path url. If any file is referenced within a CSS or Javascript file, it will need to be brought/surfaced to the "Code Snippet", otherwise they won't be replaced by the actual paths.
So if your original HTML source has an img tag like this:
<img src="product1.jpg"/>
You need to pre-upload product1.jpg into DFP and change that img src to reference the DFP name for this file using the macro. Thus it may end up looking like this:
<img src="%%FILE:JPG1%%"/>
But if you are using SVG images, you cannot currently use the macro in this way. You'll need to either host the SVG files externally and reference with a full path to them (ie: <img src="http://someserver/file.svg">) or you can paste the contents of the SVG file in-line.
BR,
Bablu Chakma

How to use cdn url with play framework and scala for image display?

In my project i am uploading the images on cdn and getting a url path to that image. But it failed to display the image on a scala template using the given url as image src. I tried (in scala template):
<img src= #model.getImageURL() alt="Image placeholder">
Here i am saving the url in database as a model property and trying to retrieve it using the getter method.
Can anyone help me out? Thanks in advance.
I believe you need to quote strings in templates, e.g. src="#model.getImageURL"

Zend display image

Hi i'm using zend framework and what i want is to show an image.
My image is in a folder /uploads/photo/default.jpg.
If i move the folder to /public/... everithing works fine but I would prefere to leave there if i can because all images are profile's image so i don't want to leave them in public...
My code to show the image is
<img id="image" src=<?php echo $this->baseUrl().'/uploads/foto/default.jpg'; ?> >
And I know that it don't work but there are a way to leave my folder there changing my code?
The images need to be publicly accessible so a browser can view them. If you don't want to physically store them in the public folder you either need to make them accessible from there (by creating a symlink from public/uploads to your uploads folder), or serve them via. a PHP script, which would be able to read the data from wherever the file is located.
Serving binary data via. PHP has its own issues, as it will be slower and you'll need to ensure you send the appropriate headers. But this would allow you to restrict access, e.g. only allowing users to view their friends' profile images, if this is your goal.

How to Intercept image load requests in WebView?

Is it possible to intercept image load requests in WebView before they are actually started and modify their URLs?
For example, I have
mWebView.loadUrl(myUrl);
In onLoadResources event I can see URLs, but I can't modify them?
The thing is I am working on application that loads html content from remote location. For some reason author excluded image path and in img src he just have file name. Existing iPhone application is using this html content and I assume the content is build the way that is the best for iPhone. So, I need somehow to figure how to alter these paths. For example, if I choose to download all images first, I would need to alter path and add file:///... in front of image.jpg name.
Thanks.
you can use onLoadResource although are not only images but any resource loaded like javascript and css