by redonkulus on 2/12/14, 4:19 AM with 24 comments
by vjeux on 2/12/14, 8:25 AM
I'm working on a blog post about it. In the meantime you can look at other image layouts I wrote about: http://blog.vjeux.com/category/image/
by drakaal on 2/12/14, 6:34 AM
Rather than having lots of weird image sizes dictate my layout, I decided to have my weird layout dictate my image sizes. The result was this:
https://www.mashape.com/stremor/automatic-image-crop-and-res...
Yes. This really does crop images for any aspect ratio. Automatically. Yes, if you try and make a picture that is just your face be 1080 tall and 90 wide it will likely choose just your nose. What do you want it to do in that scenario? this is meant for taking 4:3 and making them square, or 16:9 and making them 9:16, not for taking 16:9 and making it 1:4. But it will try its darnedest.
by bbx on 2/12/14, 7:42 AM
Keep in mind though that some simple techniques that require(d) JavaScript can (now) be achieved with CSS only. I'm thinking about how to center vertically and horizontally a fix-sized box, or how to make an element take up the whole height of the viewport (without messing with the scrolling). I myself used to rely upon JavaScript calculations to retrieve dynamically the viewport's height, whereas the browser's rendering engine could actually achieve it way more efficiently and with only a couple of lines of CSS code.
by rsxzi on 2/12/14, 7:48 AM
var h_c = (q_b - q_a + r_a * p + (r_b + r_a) *
((p + q_a - w) / r_a - p)) /
(-r_b - r_b / r_a * c - c);
var h_b = (p + q_a - w) / r_a - p + (1 + c / r_a) * h_c;
var h_a = -p + h_c - h_b;
var w_c = c * h_c;
var w_ab = q_a + r_a * h_a;
Up next - How Self Obfuscation Secured My Position As a JSPro!by noelwelsh on 2/12/14, 9:03 AM
Somewhat related, I came across an interesting method to resize images called "seam carving". It uses a dynamic programming approach to remove rows or columns that seem uninteresting. The end result is that the important parts of the image are retained when the image is resized. The wikipedia page is fairly good: http://en.wikipedia.org/wiki/Seam_carving There are nice demos on Youtube as well: http://www.youtube.com/watch?v=6NcIJXTlugc Now imagine doing this on the front-end (might be possible now in real-time) and the layouts this would allow!
by est on 2/12/14, 9:11 AM
by RyanZAG on 2/12/14, 7:23 AM
by D_Alex on 2/12/14, 8:46 AM
by ultimatedelman on 2/12/14, 8:10 AM