I was looking through all the photos in my Google Plus account trying to find absolute URL’s to my images so I could embed them into a post on my website.
When I came across the absolute URL to a photo I wanted to embed, I realised that the photo was far too wide to put on my website. At this point I was thinking what my options would be;
- Download the image and resize it manually, then re-upload it and place in my post? A fiddly, time consuming and boring process.
- Just use the absolute URL and resize the image using HTML or CSS? This is a very naughty method and not good practice at all.
- Upload the image into WordPress and let WordPress automatially resize it according to my Media Settings? My Media Settings were not configured to the dimensions I wanted.
Well, none of these methods really appealed to me, so as I like to do, I began to think creatively. One thing I had noticed about Google Plus photos is that they seem to render at all different sizes depending on how and where you view them. Sometimes they’re small, sometimes they’re full size, all without necessarily losing quality.
So thinking about this, I began to wonder if Google uses some kind of automatic system or algorithm to resize images depending on how they are being viewed. Looking for clues, I went into the photos section of my Google Plus Account and I right clicked on an image, then clicked View Image.
The image now appears by itself in the browser. I looked at the URL and noticed that a width and height value was being specified – W representing the width of the image and H representing the height of the image.
So naturally, I wondered what would happen if I changed the width and height values in the URL? To make sure I didn’t make the aspect ratio of the image incorrect, I just removed the height value and replaced it with the desired width value, for this example, I used 1000px as the width..
As soon as I hit enter, the image refreshed and behold, I was presented with my image rendered at 1000px wide and with a correct aspect ration.
To double check the image, I right clicked it and selected “Save image as” to download it to my desktop. Upon inspection of the image, surely enough it was 1000px wide. Joy!
Hopefully this is a handy little trick that you find useful. I know I certainly do. To prove it works, I’ve used this method and embedded an image from my Google Plus below.
The photos used in this article are photos from the street and owned by their respective owners. I don’t know who you are, but feel free to drop me a line. You can see more here
Let me know if this technique works for you in the comments section below.
Oh and if you found this handy, a lovely Google +1 goes a long way.