Fetch image from server and render it in - ruby

I want to fetch image from the server, save it locally and and display when user opens the show page - with Rubymotion.
I am using AFMotion to fetch the image url as follows.
In my show screen I can get the image url with news.image_url. My doubt is how do i pass this to the layout file where I can add some styles to it like

I have found a solution to my own question. This is what i have done.
In the on_load method of the show news page, I pass the image url and set the remote_image for the UIImageView to the image url passed.
I got the solution from the red potion documentation. http://docs.redpotion.org/en/latest/cookbook/networking/

Related

How to get the image blob from filepond for other components in vue

I am working on a page where there is a configuration setup and a preview pane. I wish for filepond to provide the bitmap(blob?) image when an image is uploaded so that it can be displayed in the live preview creator pane div tag rather than the element(filepond) it is originally shown on, is this possible.
I am using vue-filepond
You receive the file item in the onprocessfile callback. The file property contains the file object. You can use URL.createObjectURL and pass the returned URL to an image src to show the image.
Assuming you have an <img> on the page something like this should work.
const image = document.querySelector('img');
image.src = URL.createObjectURL(fileItem.file);
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL

what is the difference between response.write(image url) and response.binarywrite(image data)?

I am working on a VBscript asp page that is supposed to render a user's photo graph from our database, based on an ID value that is passed to the page via the URL string, to be used in various email functions. This part works great, using the following code to render it:
Response.ContentType = "image/jpg"
Response.BinaryWrite(rsAttPic("ind_photo_ext"))
I was asked to provide a default image, because if the user does not have an image on file in the DB, they get a broken image icon. After some trial and error, I finally got something to work:
if (IsNull(rsAttPic("ind_photo_ext"))) then
Response.Write("<img src='placeholderm.png'/>")
else
Response.ContentType = "image/jpg"
Response.BinaryWrite(rsAttPic("ind_photo_ext"))
end if
This works when testing it through the presentation page on the website (showpic.asp) - both images display as expected, depending on the record being referenced in the URL. However, when that page, showpic.asp, is referenced by other sources (emails sent via campaign software, confirmation emails generated by our CRM software), only the user image shows up as expected. The generic image does not show in the emails, only a broken image link.
What is the difference between the two types of image presentation? I did notice in testing that the user image appears in the browser in the center, black bground all the way around it, while the default image appears in the top left corner of the browser window, white bground. Is that related?

How to set open graph image, after load the page without og image and call the image by AJAX

After load the article/page, I then make ajax call to get the article images from API, So the images of article get loaded after page load (and that's because bring them take long time), Now I want to make the returned image as og:image value.
See as an example this page for specific car:
http://arabiauto.com/Autos/Details/63577
How make the facebook share show the image of car (that come by ajax after load page)?
Any help please?

MVC4 render image with Ajax call

Masters,
I have a scenario where i have a list of Items and on clicking single item it gets details along with image src url using ajax call.
I want to display(render) image right on page.
Now Image source URL is a FileActionResult returning Base64 string.
The problem is the page does not render image although it is having correct Src URL.
And I don't want any additional Ajax call.
Please Help.
Thanks in advance.
How are you forcing the image to be updated?
The DOM is going to keep the image the same until you tell it to refresh the image -- I would suggest using something like
document.getElementById('theImg').src="/newImg.gif?unique=someuniquestring";
where someuniquestring is a new random datetime or something (to make sure browsers like IE don't cache the GET request).

How to post a dynamic image to wordpress post?

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.

Resources