Get Facebook profile picture without resizing in iphone - iphone

I am using Facebook graph API to get Facebook details. But I am getting profile image as resized.
E.g.:
I tried changing _s to _n. But still am getting size of 180x134. But original image size is 260 × 194.
How can I get the original images without resizing in iphone?

Use this:
http://graph.facebook.com/[page id/profile id]/picture?type=large

If you want to get the exactly image size, you can try fql query
$fql="SELECT id, width, height, url, is_silhouette, real_width, real_height FROM profile_pic WHERE id=me() AND height=260 AND width=194";
$avt = $facebook->api(array(
'method'=>'fql.query',
'query' =>$fql,
));
$avt = & $avt[0]['url'];
I am using php, you can learn more here

Related

Embedded Instagram Post doesn't show the image

I use the Embed-Button from Instagram and use the generated Embed-Code:
when I embed an Insta-Post on my website without image caption, it doesn't load the image.
But when I check the the inclusion for image caption it works fine: codepen.io/cheshirecat/pen/eYjrYZr
What I'am doing wrong?

Facebook error when pulling og:image

For whatever reason, the image that I'm trying to use when sharing a link on FB doesn't load. The exact error that's being given is this:
Provided og:image, could not be downloaded. This can happen due to several different reasons such as your server using unsupported content-encoding. The crawler accepts deflate and gzip content encodings.
I'm using an s3 bucket to hold my images, and as far as I'm concerned the bucket is public and I can load these images on any browser. I'm also adding the og:image, og:image:url, og:image:secure_url, og:image:height, og:image:width, and og:image:type to the meta tags, so as far as meta tags are concerned I think I've covered all grounds. Is there a particular setting that I should be adding? Thanks of any help
For other people who end up here, I encountered this issue temporarily. The Facebook Sharing Debugger fetches images asynchronously and can give false 404s.
I recommend scraping again a couple of times to confirm.
After some time I was able to solve the problem. It turns out, the FB Sharer doesn't accept base64 images. What I was doing was directly saving the base64 binary to S3, and because of that FB couldn't display the image.
So if someone out there is doing the same thing as I was, save your base64 images to file/directory first before uploading it to S3.
In my case, this was due to the Extension of the Image.
I changed .PNG to .JPEG and it starts working.
So please try to change your extension and then try again.
At first I convert HTML to canvas, then canvas to image and afterwards this image is drawn with canvas for cropping the initial image to get rid of extra space. After this is done, the image is sent to the server for storage and passed to FB in og:image meta tag.
$scope.facebookShared = () ->
$window.open "//www.facebook.com/sharer/sharer.php?u=" + encodeURI($location.absUrl()), "sharer", "toolbar=0,status=0,width=" + 500 + ",height=" + 500 /// this is window for share fb
height=$('.sharing').height()
html2canvas document.body,
onrendered: (canvas) ->
context = canvas.getContext('2d')
image = new Image()
image.src = canvas.toDataURL("image/png")
image.onload = ->
sharing=$('.sharing')
canvas.height = Math.round(sharing.width()/1.91)
canvas.width = sharing.width()
context=canvas.getContext('2d')
pos = sharing.parent(0).parent(0).position()
context.drawImage(this, pos.left, pos.top, sharing.width() + 20, sharing.height(),0,0,sharing.width()+20,sharing.height())
$.ajax
url: '../../save_img'
type: 'post'
beforeSend: (xhr) ->
xhr.setRequestHeader "X-CSRF-Token", $("meta[name=\"csrf-token\"]").attr("content")
return
data:
base64_image: canvas.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/, "")
claim_slug: $scope.claim.slug
return false
width: $('.claim-page ').width()
height: height+115
return

Facebook Share Dialog image doesn't show

I'm using the Facebook Share Dialog (https://developers.facebook.com/docs/reference/plugins/share-links/) and the image doesn't appear. I've checked a lot of posts here in SO an other forums but couldn't find a solution
I found this site where Share Dialog works correctly: http://election.gv.my/ (They don't use meta property="og:image")
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http%3A%2F%2Felection.gv.my%2F&p[images][0]=http%3A%2F%2Felection.gv.my%2Fassets%2Fcombined.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
If I use its image in my code, it shows:
var sharer = "https://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + shareURL + "&p[images][0]=" + "http://election.gv.my/assets/combined.jpg" + "&p[title]=" + shareTitle + "&p[summary]=" + shareExcerpt;
If I use my image in its code it doesn't:
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://election.gv.my/&p[images][0]=http://mysite.com/app/wp-content/uploads/2013/03/poster.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
The only reason I can think of is something in the server configuration. I've checked my url (website & image) in https://developers.facebook.com/tools/debug and the results are OK, at least the same as that site
The problem in my case was image sizes generated by WordPress:
NO: 85x85, 96x54, 166x94, 170x96, 193x108, 711x400
YES: 356x200, 360x124
https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/
og:image – This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)
But this doesn't explain why size 356x200 is ok but no 711x400 wich is bigger and has the same aspect ratio
Try reducing the file size: I changed from 56 to 24 and it then loaded.
Try adding a second "&" before "p[images][0]" => "&&p[images][0]"

Facebook profile photo, how to make it the actual size with javascript

So I want to make a facebook profile photo its actual size:
https://sphotos-b.xx.fbcdn.net/hphotos-snc6/179672_10151462004583896_870987263_n.jpg
here's the photo.
I know that you can insert java script somewhere to make it this way, but I don't know what the javascript IS nor do I know where to put it on facebook.
Help
Thank you!
Do you mean on your webpage?
var Img = document.getElementById('ImgId');
if(Img && Img.style) {
Img.style.height = '200px';
Img.style.width = '100px';
}
If you just want to resize you can use paint, photoshop or online services like picresize and cutmypic!!

Selecting photo id, small_src from a certain album

I would like to get the ids and thumbnail image sources of pictures belonging to a certain album.I have the user_photos permission and the album_id is that of the app_user.
So far, I have tried:
https://graph.facebook.com/<album_id>?fields=photo&access_token=...
^Returns too much data like comments and tags and whatnot. I'd like to avoid that.
And FQL:
SELECT pid,src_small FROM photo WHERE aid="album_id"
url:
https://graph.facebook.com/fql?q=SELECT+pid,src_small+FROM+photo+WHERE+aid=" <album_id>"&access_token=...
Gets an empty result.
I'm planning to write an ajax photo-selector to work with my app :(
According to https://developers.facebook.com/docs/reference/fql/photo/
"src_small" -> The URL to the thumbnail version of the photo being queried. The image can have a maximum width of 75px and a maximum height of 225px. This URL may be blank.
Maybe you can try "images" instead.
For example,
SELECT pid,images FROM photo WHERE aid="album_id"
Then select one url by size range of the photo you need.