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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

switch not getting value
what am i doing wrong?
i want to populate the country list according to the category
i want to

Is it possible to put an entire 500-page book in a database with PHP?
I am working on an intranet and I was wondering if its possible to code php with mysql to enter a fu

generate seo frienly url from a text like wordpress
Convert: "åäö" to "aao", "space" to "-", "!?&q

Find occurences of unicode characters in string
I need to prohibit filenames with everything but English characters and numbers but regexp and strin

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a data

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

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