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

Move array index to end
Hey guys,
Quick question:

I have an array that looks like this:
Code: [Select]$var =

User information
Hi All,
By using t-code SUIM we get all the user details,if suppose we donot have permission t

Mail sending is slow on server
Why mail is taking time to be send on apache-linux server

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

Losing 'page' data
I have this code that allows me to update my database. But after updating, I lose the $_GET['page']

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