mozilla / universal-search-content

the iframe that we put inside the autocomplete dropdown
6 stars 7 forks source link

Crop images to fill preview well #113

Open nchapman opened 8 years ago

nchapman commented 8 years ago

It would be nice if images were cropped to fit the preview well. We could treat the image as a background and use background-size: cover to get it to fill the area.

screen shot 2015-12-04 at 2 42 35 pm

This is a good example of how it could go bad in that we'd cut off the text, but at this size it seems well worth it.

chuckharmston commented 8 years ago

That used to be the approach, but it worked really poorly in some circumstances:

screen shot 2015-12-06 at 4 56 17 am

The H&M example feels a lot less broken than this, and I think logotypes are probably a more common use case than photograph-type images that can be cropped reasonably well.

Thoughts?

jaredhirsch commented 8 years ago

If we look at this from the perspective of learning styles, we can aid visual recall by displaying images that are intimately connected with the content a user's trying to find or recover. (I'm more of a textual and auditory learner, so, to me, this is more of a theoretical improvement.)

Showing big logotypes or big favicons seems like a less powerful memory aid, so I think we're better off optimizing for the case Nick has in mind.

I don't mean this comment as a verdict or edict, just trying to push the conversation a bit deeper into the human factors. @chuckharmston, what do you think?

jaredhirsch commented 8 years ago

Note that we could also file a bug against tiny machine to exclude images which seem to be logos or icons. One cheap approach might be counting the number of colors in the image.

nchapman commented 8 years ago

We know how complex the images are. We could background cover for complex images and not background cover for simple images?