Call another image from a remote server - mod-rewrite

I'm trying to find a way to hit my server (I want my URL to show to the customer) with an image call. Say
<img src="https://tg.site.com/12345678.png" />
would be showing the image found on a remote server
<img src="https://partnersite.com/12345678.png" />
I have a rewrite that pulls and gets the remote URL string etc and I'm able to write on a page the remote image: echo "<img src ='".$fullpath."' /> but that doesn't render the remote it shows a broken image if you call the image in https://tg.site.com/12345678.png on a webpage (but if you hit the URL direct it renders the HTML.
What I believe I need to do but cannot get to work on is writing a header for the remote image.
header('Content-type: image/png'); // For PNG images.
readfile('$fullpath');
exit;
To add context: the image is used to hit a remote server that is used in place of javascript for retargeting; this allows you to put it into an email. We want it to hit our server vs. a partner so we can change technology when we want and not have to have our customers swap out image tags if we do.

Related

Google Data Studio inserted images lost when duplicating report

I have recently inserted some images into a google data studio report using both image from computer and by url (on a public domain) as graphics to make it more visually appealing.
When we duplicate the report, all of the data sources are ok but the report looses the images. It looses them even if they are hosted on a public web server accessing by https://
When I click on the image, it shows the image url in the property tab, but on clicking the button with the url it asks to upload from computer.
Is there a way to have images in the report and be able to duplicate whilst not loosing the linkage or do i need to replace the images every time.
We have tried
Uploaded image from computer
hosted image on https:// publicly accessible domain
used embeded url object to images on https:// publicly accessible domain

How to save the image in html (in crawler), which is changed to another image after about 1 minute or by reload(request)

I'm trying to make some automatic captcha input systems (recognition of figures in captcha image by deep learning and input the figure automatically)
.
For that, the captcha image should be inputted to some deep learning system.
The captcha image in some online web page is in the img src but the src is not ending with some file extension like jpg, png..
It look like the below(it is an example).
img src="/nn/mm/captchaimg?/kk=image"
The above image shown in the web browser is changing after some time periods(about 1,2 min).
If the web including the above image is reloaded, the captcha is changed to another captcha image
(It means that in web crawler, the image is changed to by each request to server).
How to save the above image which has the above special properties in html in crawler?
I'm now doing it with goquery in Golang.
I should do
Saving the captcha image in the web page got by requesting in crawler.
Getting the figures in the above captcha image using my deep learning system.
Input the figures to the form in the above web page in step 1(with maintaining the session, reload or retry of requesting should not be done) and submit
I have done deep learning system in Step 2(test be done, it works well).
But I have no idea of Step 1, 3.
Any advice will be helpful to me.
Thank you in advance.
There are lots of documents about downloading the image in golang crawlier.
But I cannot find the methods to download the images changing by requesting the image URL
(I want to download the first image when I request the web page including the image at first time).

Reference ParseFiles stored in Parse via URL

I'm working on an iOS and Android that app sends an email that contains 2 images. It doesn't attach the images to the email, rather it links to them via URL using the src property of the img tag in the email's HTML content. I would like to know if I can use Parse to store those images and reference the URLs for the ParseFiles in the email.
My questions are:
Do you just add the image to the database in a new class, or is there a separate location for public assets? (If not I can get the URL by clicking on the file which opens in a new tab in the browser.)
Is that URL guaranteed to never change so long as the image never changes? (If not I'd need to use a query to fetch the images from parse then get its url.)
Does visiting that URL for example in a web browser count as a request Parse keeps track for pricing purposes?
Piece of the email that will render the image:
<img width="186px" border="0" style="display: block; width: 186px;" src=\"http://url_to_photo_needs_to_go_here.png" alt=\"logo\">
You sure can. Every PFFile object includes a url property that you can use to directly access the file.
Simply grab this url property and insert it into the html for your email.
For reference: PFFile Class Reference for iOS (available for other SDK flavors too)

Magento SSL Friendly getImageUrl();

I have built a mega dropdown menu for my store which includes subcategory images. However when I enter to the secure part of the site I get SSL errors because the images in the menu are being loaded via http rather than https
The image tag in my template file looks like this
<img src="<?php echo $subCategory->getImageUrl(); ?>" />
Is there a way to make it so that the images are returned with the https url when in the secure part of the site?
Try disabling the blocks_html cache in the backend and see if that makes a difference.
If it does, there are several options:
Leave blocks_html cache off (yuk!)
Add secure/nonsecure to Navigation block cache key (fun, but some work)
Echo the path out with a relative protocol, e.g. src="//site.com/media/catalog/category/subcat.jpg"
HTH
Ben
str_replace(array("http://","//") That would solve your issue.
But this way the image is always fetched via https - that's not a realy solution either. For example my entire page will load in half the time it takes one image to be fetched via https.

How to capture screen application to .jpg and post it on wall

now i'm making application for facebook with javascript.but I don't know method to change my screen application to .jpg file.
So,I would like to know how to change my application and post it
Thank you for your help.
You cannot get the screenshot done client side, however you can grab the HTML code of the page being viewed and AJAX it up to your server, have your server component transform that HTML into an image.
Use this to get the HTML content of the page at the moment they want the screen capture document.getElementsByTagName('html')[0].innerHTML;
AJAX the HTML to your server
Have your server transform that HTML into an image (depending upon server-side technology you're using, there are solutions to this) (eg http://www.converthtmltoimage.com/)
two choice, store the image on your server to be the permanent place sending back the new URL for the image, or send the content back to the client.
Have the client HTTP Post the image content to Facebook for the post, or reference the URL
It's a big project, but I commend you for tackling something like this.

Resources