How to decode steam image url of thing? - api

Steam images have url like this:
http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXQ9QVcJY8gulRNRULFV_eS1M7DQEh4IEtDt7ekOQYu1aOQcGgSutizwIPYw6-mYe-AzzhQ68Mj2rmRpd-g3gXm80s9Zm_2cZjVLFH7KrlnRw/330x192
In the API can find these string:
-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXQ9QVcJY8gulRNRULFV_eS1M7DQEh4IEtDt7ekOQYu1aOQcGgSutizwIPYw6-mYe-AzzhQ68Mj2rmRpd-g3gXm80s9Zm_2cZjVLFH7KrlnRw
Is there a way to decrypt it?

I believe that's off topic.
That's probably the image hash not the image itself.
You should then make a call to download said image the same way a browser to.
From the steam API docs:
img_icon_url, img_logo_url - these are the filenames of various images for the game. To construct the URL to the image, use this format: http://media.steampowered.com/steamcommunity/public/images/apps/{appid}/{hash}.jpg . For example, the TF2 logo is returned as "07385eb55b5ba974aebbe74d3c99626bda7920b8", which maps to the URL: [1]

Related

phoenix: show image from aws s3

I study the phoenix, create an application that loads the image on aws s3, and then displays it. I was able to upload the image to the cloud, but now it is not clear how to display it to the user on the page (I do not want to make public link to these images in the cloud). I was looking for information on this issue, but did not find anything useful.
From the clouds I get the file as binary data. Do I need to create some of these data is a temporary file that will be displayed on the page? I can display the image as base64, but I think this is not the best way. I would appreciate advice.
Since you've already fetched the image to a binary, you can just send it directly to the client with the appropriate content type and the browser will render it as an image. For example, to fetch and send the png at https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png:
def index(conn, _params) do
image = HTTPoison.get!("https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png").body
conn
|> put_resp_header("content-type", "image/png")
|> send_resp(200, image)
end
If you open this in your browser, you'll see the image being rendered correctly because of the content-type header.

How to get image URL in wiki api?

When I call wiki APIs for accessing image URLs, I get image URLs like this,
File:Ad-tech London 2010 (2).JPG
How to get the correct URL of this file from wiki API?
There's little documentation on image/thumbnail URLs besides T153497. You can use Special:FilePath and/or thumb.php:
https://commons.wikimedia.org/wiki/Special:FilePath/Ad-tech_London_2010_(2).JPG
https://commons.wikimedia.org/wiki/Special:FilePath/Ad-tech_London_2010_(2).JPG?width=200 (to get a thumbnail of 200px width)
https://commons.wikimedia.org/w/thumb.php?f=Ad-tech_London_2010_(2).JPG&w=200
You can get the proper URLs from an imageinfo query like this:
https://en.wikipedia.org/w/api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=2007-12-31T23:59:59Z&iiprop=timestamp|user|url
More info at MediaWiki API Help.

Google Custom Search API Search Image by Image URL

I am working on an application which will have an option for users to upload images. Once uploaded, the application will show other images from the web which look exactly similar, whether or not of the same size.
For this, I will create a temporary URL for the image so that I could provide Google custom search API the URL of the image. I would expect in response, URL's of images that are exactly the same or similar to it, perhaps in JSON format.
I did find a similar question posted in January. Till then Google did not support anything like this, apparently:
Google Javascript Custom Search API: Search images by image url
One can also simply do:
http://images.google.com/searchbyimage?site=search&image_url={Image URL}
Since that is not part of an official API, it may not be right to use this method.
Can someone help me?
Well, the answer quite simply is TinEye Commercial API https://api.tineye.com/welcome. I was looking in the wrong place I guess, I did not have any luck with Google Custom Search API.
Would you need a simple result?
If you are, you can use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API"
Third, click "JSON" tab menu on the result.
You can be seen JSON about similar images.

Does Google Contacts API Support High Resolution Pictures?

Google recently added high resolution support (720x720) for contacts' images via the gmail interface. Previously, it would to convert all images to 96x96. However, when I post an image using the Contacts API it still gets converted to 96x96. I currently use the picture url in the link ref http://schemas.google.com/contacts/2008/rel#photo. Is there a way to post higher resolution images or are we still stuck at 96x96 if we use the Contacts API? Is there another programmatic way to accomplish this?
Thanks!
I'm assuming that you are using the Google+ API to retrieve their profile and are looking at the profile image, as seen here using the API explorer:
https://developers.google.com/apis-explorer/#search/profile/m/plus/v1/plus.people.get?userId=107345380056943591322&_h=1&
In the response is an image URL:
"image": {
"url": "https://lh3.googleusercontent.com/-2N7UIsa-tLI/AAAAAAAAAAI/AAAAAAAAAK8/XJiZoMReZr0/photo.jpg?sz=50"
},
You can alter the sz parameter to indicate the width/height of the rendered image, for example:
https://lh3.googleusercontent.com/-2N7UIsa-tLI/AAAAAAAAAAI/AAAAAAAAAK8/XJiZoMReZr0/photo.jpg?sz=500
There are other url formats, it's not clear which url you are getting but if you paste an example, I'd be happy to help.

facebook js api - HTML5 canvas upload as a photo

Is there a way to convert an HTML5 canvas to a some sort of an image format so that it can be uploaded to facebook users application album though the js api,
I'm currently successfully uploading an image link to an album with the following function:
FB.api('/me/photos', 'post', { message:'the message', url:imgURL});
Yes, there is way to convert HTML5 Canvas to an image. Following javascript function on the Canvas JS element will do this:
toDataURL('image/jpeg', 1.0);
You can have PNG also.
This function will generate a Base64 representation of the canvas image. I am not sure if you can directly give a Base64 string to the Facebook API.
If you can, then it will be great, otherwise you need to save it temporarily on the server and give that URL to the FB API.