May 1, 2012

Tip: Cropping (square) and resizing your Picasa/Blogger images

Something that we've discovered is that there is more to the crazy URL string that you get when uploading to Picasa then meets the eye. In fact, you can use that crazy URL to your advantage, having it automatically resize images (uploading a large size than having it generate small, optimized versions to your page needs) and automatically thumbnail images to a specified square dimension.

For example, this is the link to the full size image that I upload through Blogger:


http://1.bp.blogspot.com/-jrlpdLzy4_0/ThzZ62NS6rI/AAAAAAAACgQ/qS3Z-oe7Ho8/s320/%255BUNSET%255D

Changing the s-value

By adding a value (s150) before the filename, I can get the image returned but resized to a specified dimension with a maximum dimension of 150 pixels:


http://1.bp.blogspot.com/-jrlpdLzy4_0/ThzZ62NS6rI/AAAAAAAACgQ/qS3Z-oe7Ho8/s150/%255BUNSET%255D

Changing the optional flag

Other variations on this include adding -c, -p and -d to this string, each with different results, and there are others that have specific uses from other Google applications, but the below examples have been the ones that we've found ourselves using for various projects.

Optional -c flag
http://1.bp.blogspot.com/-jrlpdLzy4_0/ThzZ62NS6rI/AAAAAAAACgQ/qS3Z-oe7Ho8/s200-c/%255BUNSET%255D

This returns a square crop of the image to the specified dimension. If the image is a rectangle it returns the largest square of that rectangular image, then returns it in the specified dimensions.

Optional -p flag

http://1.bp.blogspot.com/-jrlpdLzy4_0/ThzZ62NS6rI/AAAAAAAACgQ/qS3Z-oe7Ho8/s200-p/%255BUNSET%255D

This returns a center-square of the original image with the specified dimension. You'll notice how this is different than the -c flag above.

Optional -d flag

http://1.bp.blogspot.com/-jrlpdLzy4_0/ThzZ62NS6rI/AAAAAAAACgQ/qS3Z-oe7Ho8/s200-d/%255BUNSET%255D

This prompts to download the image.