I have to handle the images uploaded by users and want to make thumbnails out of them, in order to create an image gallery.
The problem is that the images uploaded by the user differ in dimensions, so constraining the dimensions of the thumbnail will make disproportioned images as thumbnails.
Do you know how I can capture the center portion (or truncate the sides) of an uploaded image? Or do you know any script that will handle that?
Thanks a lot
Regards
EDIT:
echo '<div class="pic" style="background-image: url(upload/photos/'.$photo1.')"></div>';
and
.pic {
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}