Borrower images squared

34 views
Skip to first unread message

Paul Ericksen

unread,
Feb 10, 2011, 4:28:32 AM2/10/11
to build...@googlegroups.com
In the code that went live this week, you'll get a new sizing option for images... Squared!

As a refresher, the current options:
1) Specify height:
http://www.kiva.org/img/h300/691404.jpg the width will be automatically chosen based on the aspect ratio of the original image

2) Specify width:
http://www.kiva.org/img/w300/691404.jpg the height will be automatically chosen based on aspect ratio

3) Specify both:
http://www.kiva.org/img/h300w300/691404.jpg the image will be resized to fit inside that space, which means that for images that aren't 1:1 width/height ratios, one of the dimensions will be less than what you requested.

4) Get the original image (not the best idea to ever put this on a web page directly without having specified the dimensions. Some images can be HUGE):
http://www.kiva.org/img/orig/691404.jpg

When you request an image that is not one of the standard sizes used on Kiva's site, the request will cause that image to be generated and cached.

NEW!) http://www.kiva.org/img/s300/691404.jpg

With the last release of the code, you'll now get an addition sizing option "s300" (or "s301" or "s480") and you'll get a squared version of the photo sized to your request. The routine to square the image is not perfect and you will sometimes get people cut off if they are on the sides or extreme bottom of the photo and a lot of cropping is required to get it to a square. If the image is wide, it chops the left and right sides evenly. Group shots frequently get people on the sides chopped out. If the image is tall, it chops the bottom of the photo off since the heads are in the top portion of the photo 99% of the time.

This was implemented for something that will be going live on Kiva's site in a few weeks and for layout purposes, all images needed squaring. I switched KivaLens to use the squared images in the query results listing, but pull the larger, proper aspect ratio pics for displaying on the "Image" tab so that no one gets cut out.

There had been some discussion around the iPhone app having images getting distorted because they were being stretched to fit the view; pulling the squared image is one option to resolve that for you. There are other apps out there that will benefit from having a reliable aspect ratio for aesthetics/layout purposes. Enjoy!

Paul

jaybose

unread,
Feb 10, 2011, 8:46:29 AM2/10/11
to build-kiva
This is greatly appreciated!
The less tweaking I have to do with borrower images, the better. :-)


On Feb 10, 3:28 am, Paul Ericksen <liquidmon...@gmail.com> wrote:
> In the code that went live this week, you'll get a new sizing option for
> images... Squared!
>
> As a refresher, the current options:
> 1) Specify height:http://www.kiva.org/img/*h*300/691404.jpgthe width will be automatically
> chosen based on the aspect ratio of the original image
>
> 2) Specify width:http://www.kiva.org/img/*w*300/691404.jpgthe height will be automatically
> chosen based on aspect ratio
>
> 3) Specify both:http://www.kiva.org/img/*h*300*w*300/691404.jpgthe image will be resized to
> fit inside that space, which means that for images that aren't 1:1
> width/height ratios, one of the dimensions will be less than what you
> requested.
>
> 4) Get the original image (not the best idea to ever put this on a web page
> directly without having specified the dimensions. Some images can be HUGE):http://www.kiva.org/img/*orig*/691404.jpg
>
> When you request an image that is not one of the standard sizes used on
> Kiva's site, the request will cause that image to be generated and cached.
>
> NEW!)http://www.kiva.org/img/*s300*/691404.jpg

Chris in Texas

unread,
Feb 11, 2011, 11:56:05 AM2/11/11
to build-kiva
Oh yes, that is MUCH better!

Before - http://i55.tinypic.com/iqy35s.png
After - http://i55.tinypic.com/2nc3uz6.png

As a side note - the build.kiva article on pictures does not mention
any of the above methods for getting images. It only lists 5
different sizes available (ie does not specify that we can make our
own image sizes).

Chris

Chris in Texas

unread,
Feb 11, 2011, 11:57:25 AM2/11/11
to build-kiva
To clarify in the above images, you are looking at the thumbnail on
the left side of each table cell (ignore the nasty colors, tabs, and
everything else that is distracting on that screen :)).

Chris

Skylar Woodward

unread,
Feb 11, 2011, 12:08:47 PM2/11/11
to build...@googlegroups.com
Actually, in the past, it was advised not to make your own images and to abide by the fixed values that are usually pre-cached by Kiva.

However, in the worst case, if custom sizing causes overload, we'd likely have to enforce the restriction to the allowed values. So consider this a warning that your custom images may not always be available.

We should have some updated docs soon on officially supported "squared" sizes.

> --
> You received this message because you are subscribed to the Google Groups "build-kiva" group.
> To post to this group, send email to build...@googlegroups.com.
> To unsubscribe from this group, send email to build-kiva+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/build-kiva?hl=en.
>

Vijay Kiran

unread,
Feb 10, 2011, 12:39:04 PM2/10/11
to build...@googlegroups.com, build...@googlegroups.com
This is fantastic improvement!!

My crappy iPhone app looks so much better with squared images. 

I'll share the beta with you guys very soon. 

./ Vijay
--

Matt

unread,
Feb 10, 2011, 10:44:50 AM2/10/11
to build-kiva
Fantastic--just implemented this on KivaLive.com so no more image
stretching :)

Matt

On Feb 10, 3:28 am, Paul Ericksen <liquidmon...@gmail.com> wrote:
> In the code that went live this week, you'll get a new sizing option for
> images... Squared!
>
> As a refresher, the current options:
> 1) Specify height:http://www.kiva.org/img/*h*300/691404.jpgthe width will be automatically
> chosen based on the aspect ratio of the original image
>
> 2) Specify width:http://www.kiva.org/img/*w*300/691404.jpgthe height will be automatically
> chosen based on aspect ratio
>
> 3) Specify both:http://www.kiva.org/img/*h*300*w*300/691404.jpgthe image will be resized to
> fit inside that space, which means that for images that aren't 1:1
> width/height ratios, one of the dimensions will be less than what you
> requested.
>
> 4) Get the original image (not the best idea to ever put this on a web page
> directly without having specified the dimensions. Some images can be HUGE):http://www.kiva.org/img/*orig*/691404.jpg
>
> When you request an image that is not one of the standard sizes used on
> Kiva's site, the request will cause that image to be generated and cached.
>
> NEW!)http://www.kiva.org/img/*s300*/691404.jpg

MPKeefe

unread,
Mar 17, 2013, 10:13:54 AM3/17/13
to build...@googlegroups.com
Hi Paul,

I have just happened to come across this post for the first time. I was unaware that options 1 and 2 are available, since they don't appear to have been publicly documented (ie, http://build.kiva.org/docs/data/media ). Are they officially supported?

Very best,
Mark

MPKeefe

unread,
Mar 17, 2013, 10:19:14 AM3/17/13
to build...@googlegroups.com
Okay, it would have been good to make sure I'd read the whole thread before replying. The question becomes, are ALL of the options in Paul's first post officially supported, or only what is currently documented on http://build.kiva.org/docs/data/media ?

Martin Butt

unread,
Mar 17, 2013, 2:13:15 PM3/17/13
to build...@googlegroups.com
Hi Mark,

That documentation is due a tidy up. There will be revise version in the next build. In short, you can specify any image size you want, using any of the formats in Paul's message.

Cheers,
    Martin




On 17 March 2013 07:19, MPKeefe <mpk...@gmail.com> wrote:
Okay, it would have been good to make sure I'd read the whole thread before replying.  The question becomes, are ALL of the options in Paul's first post officially supported, or only what is currently documented on http://build.kiva.org/docs/data/media ?
--
You received this message because you are subscribed to the Google Groups "build-kiva" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build-kiva+...@googlegroups.com.

To post to this group, send email to build...@googlegroups.com.



--

Martin Butt | Software Engineer

Kiva – Loans that Change Lives
Join us on Twitter
Facebook and LinkedIn!

Paul Ericksen

unread,
Mar 17, 2013, 2:29:38 PM3/17/13
to build...@googlegroups.com
It's best to use sizes that are in use on Kiva's site. For example, s200 is what is used for the Lend tab. They will serve faster since they've already been cached. If you request a size that is not in use, the site will generate one for you, but that isn't as fast as using one that is already in use.
Reply all
Reply to author
Forward
0 new messages