Is there a known API endpoint for Pinterest profile pictures? - pinterest

It looks like pinterest photos are stored in a very simple manner. They appear to have addresses of the form:
http://media-cache-ec0.pinimg.com/avatars/username _ timestamp _ size.jpg
username is the pinterest user
timestamp is the unix timestamp when the photo was uploaded
size is the pixel size of the resulting image's width and height (known accepted values are 140 and 30)
Of course, using this link is basically impossible, as I don't know the time of upload.
Any ideas?

Related

Passing coordinates values from google sheets columns in static map URL

I've been trying to fill a google spreadsheet column with static satellite maps giving the coords from latitude and longitude columns.
Something like this:
=IMAGE("https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/"&K1&","&J1&",14.25,0,60/600x600?access_token=API_KEY")
My problem is constructing the API call using Lat, long pairs stored in the Google Sheet cells.
I am getting a range of errors from both Google sheets and mapbox, so obviously my syntax within sheets is bad. When I type the url in a browser, with hard-coded lat,lng the correct map image is displayed.
A typical Google error is
Function ADD parameter 1 expects number values. But
'https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/' is a
text and cannot be coerced to a number
Can someone please assist?
I think you had Lat, long wrong way around. Some mapping systems require Lat, Lng and others Lng, Lat (go figure!)
If you change as below, you will get an image, but you may need to play with other parameters to get it working as you need.
=IMAGE("https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/"&K3&","&J3&",14.25,0,60/600x600?access_token=API_KEY")
You can also use the form below which is another way to construct the API string from the component parts.
=image(concatenate("https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/",K3,",",J3,",14.25,0,60/600x600?access_token=ACCESS_KEY"))
In both cases, the parameters after the Coordinates represent the desired zoom, orientation angles and image resolution. You can play around with image formats here https://www.mapbox.com/help/static-api-playground/.
Also note that you have options in Google sheets to adjust how the image is displayed (resize, stretch etc) in the cell, using the IMAGE parameters. This is explained here https://support.google.com/docs/answer/3093333?hl=en

How to get photo files in original size from Instagram?

Dear fellow community!
Does anyone know how to get the photo files in original size from Instagram? They surely store original files in full size, since you can upload a photo via app to your IG profile, delete it from the phone, and it still syncs your IG with phone library to get this photo back in full resolution.
Their API supports fetching up to 1080x1080px, plus I found this method via Chrome developer tools: http://www.dailydot.com/debug/instagram-high-quality-photos-download-google-chrome/. Script that could do it doesn't seem reliable on large scale, so I'm still looking for a automated better solution.
Please share any experience that could help.
Try to change 640 to 1080 and remove sharpness like in my example:
str_replace(array("s640x640","sh0.08/"),array( "s1080x1080",""),$img['standard_resolution']['url']);
all photos on instagram have real image url (except profile picture image), you just need get access instagram api, decode json result then get real url image.
you can see my example code for search tag using instagram api : http://pastebin.com/fMu7w808
Sorry to say, but the code on the pastebin will not work correctly for this purpose. Standard_resolution does not display the representation for original size of posted media.
$url = $datas->images->standard_resolution->url;
Will yield the following result, while the original image that was uploaded is 1080px wide. (Following is an example, not a working link)
"standard_resolution": {
"url": "https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/14613148_236279861425099_8741797152912868864_n.jpg?ig_cache_key=MTX3ODU5Mjg5NDY4NDEEN3E0CA%3D%3D.2",
"width": 640,
"height": 334
}
The trick is to replace the s640x640 part in the url, thus adding the next line in order to get the url of the picture as it was uploaded :
$url=str_replace("s640x640/","",$url);

Image similarity detection

I've been playing around writing a scraper that scrapes Deviantart.com. It saves a copy of new images locally, and also creates a record in a Postgresql DB for the image. My problem: as new images come in, how do I know if this new image corresponds to an image I've seen before? Dupes are fairly rare on DA, but at the same time, this is an interesting problem in a more general sense.
Thoughts on ways to proceed?
Right now the Postgresql DB is populated as I scrape images, and which has a table which looks like:
CREATE TABLE Image
(
id SERIAL PRIMARY KEY NOT NULL,
url varchar(5000) UNIQUE NOT NULL,
dateadded timestamp without time zone default (now() at time zone 'utc'),
width int,
height int
);
Where url is the link to the image as I scraped it from DA (ex: http://th05.deviantart.net/fs70/PRE/f/2014/222/2/3/sketch_dump_56_by_lilaira-d7uj8pe.png), dateadded is the datetime the scraper found the image, and width & height are the image dimensions.
I currently don't store the image itself in the database, but I do keep a local mirror -- I take the url for the image and wget -r -nc the file. So for a url: http://th05.deviantart.net/fs70/PRE/f/2014/222/2/3/sketch_dump_56_by_lilaira-d7uj8pe.png I keep a local copy at <somedir>/th05.deviantart.net/fs70/PRE/f/2014/222/2/3/sketch_dump_56_by_lilaira-d7uj8pe.png
Now, image recognition in the general case is quite hard. I want to be able to handle things like slight resizes, which I could account for by normalizing all images kept to a specific resolution, and normalize the query image to that same resolution at query time. I want to be able to handle things like change of format (PNG vs JPG vs etc) which I could do by reading an image file into a normalized format (ex: uncompressed RGB values for each pixel, though ideally some "slack" would be tolerated here).
Nice to haves (would be willing to give up for simplification/better accuracy):
I'd like to be able to handle cropping an image (ex: I've previously seen imageA, and somebody takes imageA and crops it and uploads it as imageB I'd like to notice that as a duplicate).
I'd like to be able to handle watermarking an image with a logo
I'd like to be able to handle cropping in a case where the new image to classify is a subimage of a previously seen image (ie - I have imageA stored, somebody takes imageA and crops it, I'd like to be able to map that cropped image to imageA)
Constraints/extra info:
I'm not at all interested in finding images that are different yet similar (ex: two distinct photos of the same Red Bus should be reported as two distinct images)
while I'm not entirely opposed to using metadata (ex: artist, image category, etc), I'd like to keep this as constrained to just the image data (EXIF data, resolution, RBG colour values) as possible.
an image that is sized down and appears in a new larger image I wish to consider as different. Ex: I have imageA, I resize it to 50x50, and that 50x50 grid appears in a new image, I would not consider the new image "the same" as imageA (though I suppose by the criteria outlined previously I would consider imageA a duplicate of the new image)
It would be nice but not required if one could detect "minor" revisions in the image (ex: a blanket change to the the gamma value in an image, etc)
Thoughts? Suggestions?
For my use case I'm far more concerned about false positives than false negatives, and as such a "fuzzy match" approach should err on the side of caution.
In case it matters I'm writing all of this in Python, though TBH I'm happy to use an alternate tech if it solves my problem elegantly/efficiently.
I would grab a small subimage somewhere not near the edges, and cross correlate this within the vicinity of its source location in your database images. You can resample it prior to cross correlation to account for small resizes, and you can choose the size of the vicinity that you match against to account for asymmetrical crops of a certain percentage.
To avoid percect fits on featureless regions (e.g. the sky) you could use local image variation as a selection criterion for the subimage location.
This would still be quite slow, so it will be necessary to use a global image metric to first select candidate duplicates from the database (e.g. the color histograms mentioned by danf).

What is the maximum resolution of an 'img' in a Windows Store App?

I'm writing a windows store app, which uses a zoomable/pannable div to show a large image and allow a user to locate specific sections within the image.
Through this work I've been provided an (admittedly huge) image (from a design house) which does not render when set as the img.src (loaded via a blob from a storage file object). It just shows a plain white screen where the image should be.
The image in question is > 35000 pixels wide and about 11000 high.
I've established that re-saving the image (as large as Fireworks would let me!) with a 10000 pixel width renders as expected.
I'd like to go back to the design guys and let them know the maximum size that the app will support, but I can't find this information anywhere.
Does anyone have any ideas as to the limits here?

Is it possible set the JPEG quality using the get_serving_url() in Google App Engine?

When using get_serving_url(user.photoBlobKey) to return an image URL from the GAE Blobstore, the Google Images API returns a JPEG image with quality = 70 and size = 512px as default.
Is there any way to increase the default JPEG quality returned by get_serving_url()?
There's an undocumented URL parameter l, you can add it to the end of the image URL like so: =l100 (or =s640-l70 if you have another param before it) that should modify the output quality of the JPEG. Seems to be =l1 to =l100.
See also: List of all the App Engine images service get_serving_url() URI options
No there is not.
If you think it's a useful feature you can add an item to the issue tracker, from there the team will assess the demand for implementing it.
you can't control the output quality but by requesting
get_serving_url(user.photoBlobKey, size=0)
you will get the original size of the image up to 1600px height and width.
the returned url will be automatically postfixed with =s0 which you could add also before rendering the image in the template for example.

Resources