1

So I was reading on Quora and came across this awesome picture:

http://qph.is.quoracdn.net/main-qimg-fa81af575c5e0ef69d78fc011a71e865?convert_to_webp=true

Trying to isolate this resource I noticed the odd url. I want to understand what's going on there... and why I cannot a save a valid picture file of this using the "Save Image as..." option when I right-click it (I'm using Chrome). It saves a file but is "corrupted" (or so says Image Viewer) yet it was saved from a valid image rendered on my browser.

Is the CDN messing with the file extension of the picture on purpose as a way to combat saving? How is it that my browser can render it despite it being served by such a URL (with no file extension)?

Note: I am not trying to infringe on the copyrights of whomever owns this picture. I also know it's easy enough to actually "save" a valid copy of it by just doing the old Ctrl-C + Ctrl-V into a image editor. My question is specifically about the way the CDN is serving the image thru that weird URL... and the purpose behind it.

PS: trying to view the saved file (in various PCs) results in this: enter image description here

  • When I visit your link I can right-click and save the .jpg no problem. Tested with Firefox and Chromium. I don't think they are doing anything tricky, but you can drop the ?convert_to_webp=true from the end and replace it with the image type as a workaround. – Tom Brossman May 14 '14 at 7:26
  • Did you try to open the saved jpg file to view it? Yes one can drop the url param, but changing the link to http://qph.is.quoracdn.net/main-qimg-fa81af575c5e0ef69d78fc011a71e865.jpg results in an error being sent back (in XML), so I think it's no a direct link to the static file. – unknownprotocol May 14 '14 at 15:41
  • It fails in Chromium on Windows with the error the OP Reported – eyoung100 May 14 '14 at 16:00
5

I just figured this out. That cdn is using a Script called convert_to_webp. I can't tell you what language it was written in. It is short for Convert to webpage, which accepts a boolean value(true or false) If covert to webp is true you must Save the Page as HTML. If you want the actual picture, go to the link you provided in your post, and change true to false.

UPDATE Content Download Networks must pay for their bandwidth, just like the rest of us. Consider the following example:

Code for html page... img src="http://somesite.com/somepost/someimg.jpg" alt="[someimg]" width="x" height="y"

vs.

Code for html page... img src="mylocalimgdirectory/someimg.jpg" alt="[someimg]" width="x" height="y"

Case 1 Generates traffic on your site + the server at somesite must answer. Your page takes longer to load because somesite must reply. If somesite breaks or moves someimg somewhere else your page gets the nasty X placeholder. In the olden days of the net, this was acceptable, as somesite could answer the request sent to your ISP Faster than the modem could load it the 1st time.

Case 2 on the other hand forces the Host of the page to host his own images. This decreases load time, and increases perceived speed, because there is no intermediate request to somesite.

Now the reason the script exists is to prevent me from using Case 1 to directly link to the image. A novice web author will remove the Script by removing everything past the ? and use that as the img src but without the script the default setting is true, which renders the image as a page, which in turn breaks the link in your html page. There is also no way for me to cheat unless I change the parameter to false, which allows direct linking, but most likely the IP Address of my site will be blacklisted for causing a traffic spike on the CDN, or the CDN will contact me, and offer 2 choices.

  1. Stop "sharing resources" or we will ban your site from using us. (Blacklisted)
  2. Become a paying customer, and you can have access to our CDN

Some examples of this include WordPress.com vs WordPress.org, and My Hosting Provider PowerDNN vs DNN. Each paid subscriber earns the right to use special internal tools because they are paid for. In short, the CDN is preventing loss of profit due to Free Loaders. See Item 7

  • That that seems to do the trick to let you save a "not corrupted" image. But I wonder why they do this... – unknownprotocol May 14 '14 at 17:06
  • My guess is to prohibit free image hosting. See Edited Answer... – eyoung100 May 14 '14 at 17:09
  • Nicely detailed answer. – dan May 14 '14 at 21:38
  • @dan Thanks, The ones I get right, I like to get REALLY RIGHT, as it's a slow uphill battle with the rep right now, on this SE and the others :) – eyoung100 May 14 '14 at 21:56
  • @ECarterYoung You're doing great here. This is a well-thought-out, responsive answer, with a link for more info. The rep will come with more answers like this :-) – dan May 14 '14 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.