Google image search strange redirects - html

I discovered a strange behaviour in google image search. Let me start with an example:
I want to find a picture of a cat. I type cat in google images, press enter and I pick this little one:
http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg
[I just inserted the link of the original image]. When you try to follow this link at the very first time, it will do two redirects:
Request URL:http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg
Request URL:http://www.freegreatpicture.com/1562
Request URL:http://www.freegreatpicture.com/cat/photo-1562
The response to the 3. request content types is text/html. Basically it loads the website where this cute kitty lives. So now the kittens images is cached, if you would try one more time to hit this URL:
http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg
It would load the image. Super! But what about when you would try this from a native client app? I mean I would want to download the image and show it in a picture box. It wouldn't load the image and you would have no idea why. It would gave back the text/html content what is not image/jpeg.
My question is, is anyone met with this problem? Any work around that to filter out this kinds of urls?

Related

HTML image doesn't loud from GOOGLE CLOUD

I have minimal knowledge of coding but I just spent the past 6 hours trying to resolve this issue.
Go here to see the image I am trying to have load.
If I am suppose to chance the SRC lines, how and where do I do that?
The HTML image loads perfectly from my computer.
Like what #mlegg said, I get the same error when trying to go to your link. It looks like that is no longer a valid URL or there is some form of security on it so it's only accessible from your computer (since you said it works from your computer?).
It could also be getting pulled from your browser cache if it was a good URL at one time. Try doing a Shift + Refresh of the page or purposely clear your cache.
If you have the image locally you could try uploading to a different web based repository and src it from there.
Just to cover all bases, I trust you know how to put an image on a web page using the img tag:
<img src="http://lorempixel.com/400/200/">
You might also want to try a different image that you know is available and accessible. You can use the URL above for lorempixel.com or you can scrounge up a different image from a Google Images search.

image is getting cached , but not getting displayed?

I have an image :
<img id="img1" src="http://igyaan.in/wp-content/uploads/2013/03/Nvidia-580x362.jpg" />
The image from the url is getting cached, but image is not getting displayed.
I analysed it using firebug, where I could see a GET request to the image, and image is returned. And in addition, there is a request to some facebook pic which I never requested (firebug: Bad request):
http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/424831_319096764809781_1948053300_n.jpg
jsFiddle: http://jsfiddle.net/Qb6YX/5/
Any idea why this is happening? And how do i solve this issue?
MoreInfo : iam working on a Rss feed reader , it displays images of posts . I had trouble with this specific website.
It is likely that the image is hotlink-protected. That's why it gets redirected when you try to load it on your page. In this case you should use a server-side proxy to retrieve the image and load it from there.
Using an external service from Images.weserv.nl:
<img src="http://images.weserv.nl/?url=igyaan.in/wp-content/uploads/2013/03/Nvidia-580x362.jpg" />
See jsFiddle
It would be better if you host the proxy script on your server for this purpose so that you have fewer dependencies for your RSS feed reader.
However, there are times when we should respect the site owner's decision of hotlink protection. One way to go about it is to replace an image that cannot be loaded with a default one.

Images not appearing in Facebook's share link tool

I am having an intermittent issue the Facebook share link function does not pull the the link image from the page. This is happening consistently intermittently, that is, it keeps happening but not for a consistent page, image, style, etc. I can't find any pattern. Pages won't work, and then they will. Most pages work fine at the first attempt, but maybe 5% fail.
Each time it happens I check the URL in the Facebook debug tool, and it finds the article image without problem. Often, after I use the debug tool and then try to share the link again the image is found by Facebook.
The site uses Open Graph tags that check out with the Facebook debug tool.
Here is one example page:
http://zujava.com/must-have-school-supplies
Are there other factors that impact whether an image is pulled along with a URL in Facebook?
Facebook scrapes your page every 24 hours. So on the initial go unless you like the page or send it through the debugger, the image (and other meta data) will not appear.
Read more at
http://developers.facebook.com/docs/reference/plugins/like/#scraperinfo and
How does Facebook Sharer select Images?

get meta information of a picture from link

Is there any way at all to get the meta information about a picture from a link without download the picture it self?
Like i have this url to a picture http://www.abc.com/picture.jpeg, i want to get the meta information such as the dimensions of the picture with out actually downloading the picture it self.
Of course I want to do this by writing a program, because there is large amount of pictures to go through.
I doubt you can get information about an image without downloading it. For example, when you visit a website and it has an image on it, the browser only knows the dimensions of the image after it has downloaded it. This is especially true if you want more advanced metadata such as time picture taken, iso, exposure, etc. The URL carries no information except if you can get some information from the parameters. Ex: http://www.abc.com/picture.jpeg?x=100
Sorry :/.
You might maybe want to look into downloading a thumbnail of the image, or maybe there is a way to not download the image pixel data but only the EXIF metadata which would cut down on download time/costs but still get you that metadata you want. I have no expertise in that subject though.
If all you have is a URL, than all you have is a URL. There's no magic incantation that will extract more data than there is from it. I.e.: No, you'll have to download the image.
If you have control over the server serving the image, you could make an HTTP HEAD request, have the server evaluate the image and output meta information about the image in the HTTP header, essentially creating a custom protocol for this purpose. That's a lot of ifs though and really depends on what you want to do.

Missing IMG src leading to multiple unknown server requests

Hey my application has a map that is drawn with custom marker images rendered on OpenLayers VectorLayer. The problem here is that I see a lot of requests to the page that has this map and this comes to the server and all the server side code written for that page is executed and HTML is returned to the client and I get an error saying
Resource interpreted as image but transferred with MIME type text/html.
My guess is that the markers rendered on the page are rendered as img controls but their src is set to blank. You can read more about what happens when your control is having the src value as empty here: http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/
I want to find out if these markers are what that is causing the problem or something is kicking off a infinite redirect which is not the case as I always see that it stops after a certain no of requests.
As mentioned in the post above it happens only on Webkit browsers and not on FFX.
Can someone help me find out the src of these requests if there is someway I can track it.
Thanks in Advance.
"Can someone help me find out the src of these requests if there is someway I can track it."
Sure.
Presuming you have Firebug installed, open the Firebug panel and click the Resources tab. At the top, in the left pane that lists tons of stuff, you should see a folder that represents your web page. Open that folder and look for Images. If anything is broken or missing or linking to the wrong place, you would be able to see it there.
If that doesn't satisfy your needs, click the Network tab in Firebug. If you don't see anything there, reload the page. You'll see, more or less, in chronological order, all the page elements that should have been downloaded to render the page, even the parts that are missing.
Look for the image(s) in question, click it once on the left, and you'll see the Headers, Preview, Response, Cookies and Timing tabs on the right. You'll want to look up the information in the Headers, Preview and Response tabs. Additionally, if you find an image you're interested in, you can also double-click the name on the left and see where that leads.
There are some other tricks, but at the very least, this should give you some ammunition to start your troubleshooting.