I am doing app that will load URLs that user added. App will load URLs from database and show them images but when i put variable in image source it shows nothing and when Itry to put url directly like this Source = "/memory/....". It shows it. It should look like this:
Code looks like this:
How to load these images from URL variable?
Like Jason mentioned in his comment on your question, just repalce the FromFile(...) in line 43 of image 2 with FromUri(...).
See the docu of teh function here, Docs MS
Related
I created project that goes to 7 or so different pages on my website (home page, product pages, etc.) and I want to take a screenshot of the page after each step. I want the name of the saved screenshot to include the type of page I'm on, which I have set in a variable on the step. I added this to my hooks.rb file, but I don't know how to include the type. Can someone let me know the best way of going about this?
AfterStep do |scenario|
screenshot = "#{scenario.name}.png"
#browser.driver.save_screenshot screenshot
embed screenshot, 'image/png'
end
to name it something like scenarioName_image_png.png you would use:
screenshot = "#{scenario.name}"
#browser.driver.save_screenshot screenshot
embed("#{screenshot}_image_png.png")
for something like image_png_scenarioName.png change the last line to:
embed("image_png_#{screenshot}.png)
I want to display an image on our MediaWiki site using the description from its file description page as the caption in the syntax [[File:imagename.png|frame|caption]]. To clarify, I'm not trying to link to the image's description page.
I've read some things about querying the API on this question but I'm struggling to see how I can display the result of the query on the property (be it iiprop=comment or rvprop=content or...something else) in the source itself.
If this is a locally uploaded file, and your description pages don't have extraneous formatting, you could get away with something like this:
[[File:imagename.png|frame|{{File:imagename.png}}]]
But there's plenty of ways that can go wrong...
I have aroung 6k posts with images and now I need to link all them to the source image (to open them with pretty photo and make them "responsive") there are no custom fields with src links, simply html code with src.
Any suggestion in how to do it?
Thanks in advance!
You could use a javascript code that you embed in your template. This code looks for all images in the post content and modifies them as wanted. With jQuery something like that:
$("img").attr("src", function() {
return "/resources/" + this.title;
});
- taken from the jQuery Docs
The down-side of that is that this script has to run everytime the post is requested again. The alternative option would be to write a php script to replace all links in the database once. That is probably more effort at first but in my opinion worth it since its a one time job.
Can anyone help me to solve my issue regarding the image downloading function? The situation goes like this: actually I wanna download a gantt chart image from a site that generates some string url as the image! not even http://www.example.com/img/image.png but something like http://www.example.com/img/index.php?=task&d=&Work=0...
Disregarding what language or environment you are working in, simply using the full URL with all the GET variables in place will provide you with the image.
It should not matter.
Judging from your comments below, your code is not working because you are using PHP's htmlspecialchars function.
Htmlspecialchars will turn symbols that you cannot represent in HTML output simply by adding them to the source of an html document (such as &, < and >) into identifiers that will let the browser know what kind of character to render.
for instance the ampersand (&) could be rendered by & the HtmlSpecialChars function does this for you.
When your backend code is outputting parts of html source that aren't visible to the user, such as the source of an image in this case, you do not want to use that function.
It will invalidate the URL by replacing all the & instances in the url by &
Simply do this:
<?php print($url); ?>
I want to put a image into a post, but it seems I just cannot get it work.
For example, this one:
http://stockcharts.com/c-sc/sc?s=ACHN&p=D&b=5&g=0&i=t88400486500&r=9913
The output is a PNG file. So in HTML tab, i put,
< img src="http://stockcharts.com/c-sc/sc?s=ACHN&p=D&b=5&g=0&i=t88400486500&r=9913">,(I leave a empty space between the < and image otherwise, stackoverflow won't allow me to put a image tag here) it just won't show up the correct image. The image you will see is "go to stockcharts.com to view this chart", that is because the URL is wrong. If the URL is correct, the image will display fine. Any way to work around?
I was trying to play around with the formatting.php file, but so far, no luck.
(It is quite strange though, if you put the URL into your IE URL bar, and press enter, it shows up fine with a chart.)
Thanks.
Your URL is a web page, NOT an image. When you try to insert the link as an image, the html IMG tag is used to specify the FILE NAME to be inserted. The file can be on a different url but it should not refer to just another uri.
to get around it, you have 4 options:
Specify the image file name directly and not the uri with the img tag.
Use iframe and put the uri
use frame (I'd not go for this)
Use Ajax and fill it in a DIV tag - most effective in my opinion.