Display thumbnails as square while retaining aspect ratio


Posted on 16th Feb 2014 07:03 pm by admin

I am trying to figure out a way to make an image display as a square, for example 80x80 pixels, when the source file is rectangular.

The catch is that I want the image to look normal (not squished) so the image has to be "cropped" or something, for lack of a better term. However, it should not modify the original file, just change the way it is displayed.

It would be great if I could easily tie it into a <img> tag, so I can change the way it displays exactly where I want it to, and not where I don't.

I haven't been able to figure this out, any help is appreciated!

No comments posted yet

Your Answer:

Login to answer
96 Like 10 Dislike
Previous forums Next forums
Other forums

PHP / MySQL Associative Multidimensional Array:
Hello.

I have data in a MySQL Table that adheres to the below: (note, no index, could add if

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

Fetching array then reversing it
Hi, I have a simple problem, I'll try to explain it as best I can:
News entries in my database ar

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

Entering Data Problem
Code: $result = mysql_query("SELECT * FROM flights");
while ($row = mysql_fetch_array($

HTML Form Server Side Validation
Hi, Im new here, im currently doing a website for a friend, and I have designed using snippets from

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash