Facebook Connect - displaying profile pictures the best way - php

I have a site set up with Facebook connect. I also have profile pages, which show users Facebook profile pictures. If users are not connected via Facebook they still have the option to use a profile picture by entering the url of it.
The Facebook images are using the type=large so they are the true Facebook size (I think). Now the problem I have is, what if someone uses such a large image? And it ruins the UI of the page? I cannot set the size of the image (via HTML) as it will not look right for the Facebook profile images.
What's the best way of going about this? By the way I'm using php.
Thanks

If you have a fixed width/height for your image holder, you can set ONLY the width or height of the image via HTML in your <img> (preserves aspect ratio), then set overflow:hidden on it to preserve your UI. Depending on the design of your page you might also want to add a background color or image to it.

Related

How to get Facebook to thumbnail an image from URL in post

I'm building an image library site. It will be mostly private but I'd like users to be able to directly use certain images in facebook posts by special URLs.
The URLs look plain enough: http://example.com/some/path/image.jpg although they're actually generated on demand by a script.
But when I paste that URL (the URL of the image, not a page with the image on) to Facebook it just comes up with the domain name; it does not thumbnail the image.
There are many questions about open graph meta tags - but that's to do with pages, and this question is about the case of a post with a direct image URL. I notice that it works for images from imgur, for example.
Is there something in the way the image is served, or something about the quality of the image itself that I can change to get facebook to work? Or is it just something like facebook knows to treat certain image sites a different way?
Thanks.
I think Facebook grabs the image using some kind of OpenGraph "Browser". So you need to serve it meta information depending on the User-Agent, which is
facebookexternalhit/1.1 (+https://www.facebook.com/externalhit_uatext.php)
for Facebook.
So when a user browser hits your URL you serve the image, when it's facebook you serve it open-graph meta-data.
The only thing, off the top of my head, that I can think of is your favicon for that page.
Visit http://www.w3.org/2005/10/howto-favicon for information on favicons in html.

How to specify Thumbnail image size in facebook page sharing?

I am developing a website in PHP and I am implementing facebook sharing. I am able to select the correct image using link tag like the following (a start tag in before link)
link rel="image_src" href="http://www.code-digital.co.uk/preview.jpg" />
But Is there a way to customize the image thumbnail size? I want to show a bigger image. Please help.
since you are using php you can select the right image with right size for you,save it to a file on your server with php, then use it as thumbnail.

Galleria, Adsense, and onLoad

(1) I am looking at image galleries and I would like to attach Adsense to my image gallery.. I found this Galleria image script and I'd like to add adsense to it. I have been looking around and asking questions but can't find anything.
(2) I'd like to load the images as the user scrolls down the page instead of all at once. I have no idea where to even get started with that.
Anyone done this or could do it?
http://galleria.io
What you could do is add to you list of images a transparent image (gif or png) and place your banner under the galleria controler/div. You can even have a custom image for the thumbnail so it doesn't appear you have an empty image in the list.
Having somehow the banner in the list directly will probably get your adsense account closed as at any display of your image/ad you'll request it from google and they don't allow excessive requests / page. But this would need a lot of tweaking w/galleria script.
Cheers

How can I generate a thumbnail of a web page for a facebook post?

My app is posting to users' Facebook walls, and linking to a page they have created. The page is in html. I'd like to be able to put a thumbnail of the page as the image on the wall post. I'm not sure whether this is possible or not. Anyone have any ideas?
If it helps, the page itself is stored as a series of 'elements'... for each one, I know the size and position of the element, and the content (which may be text or an image). So I can pull all that in from the database.
I guess it would be sufficient to create a thumbnail using php at the point when the user clicks 'Publish This to my wall', if that's easier than doing it on the fly - I can save the image and then link to it.
Any ideas?
I create thumbnails for my site using CutyCapt, which works very well indeed on both Windows and Linux. You can use exec to invoke this from php.
There are also web services that allow you a quota of free thumbnail snapshots, that are easy to integrate into your website. e.g.
http://www.websnapr.com/
or
http://webthumb.bluga.net/home
I figured out how to do this. I used the PHP gd library, which allows you to create a base image and then add images and text. Works pretty well.

How can I get Wordpress to ask for a custom image width on every image I upload?

I'm designing a blog for someone who wants to use a custom size for every single image.
The easiest way would be to just have a field on the image uploader next to where it asks 'medium, large' etc. saying "Width:_". Then the image will be scaled to be that width and embedded in the post at that size.
I can see there would be lots of ways to hack this in, or write a plug in to do it - but is there an easy way to do this, or an existing plug in?
Thanks!
Cole
If the user is logged in, writting a post/page,
once they click to upload a picture, if they are on the visual editor.
then just click on the image and select the "Edit Image" button that pops up,
the dialog window opens with 2 tabs at the top, click on "Advance settings" tab
and they can select the width & height from there?
The best solution I found to this was the plugin by Walter Vos, http://www.waltervos.com/wordpress-plugins/additional-image-sizes/ which allows you to specify new image sizes globally. It's well written and did just what we needed.

Categories