Grow your CSS skills. Land your dream job.

php resize image

  • # March 20, 2013 at 4:21 am

    I am working in a cms project where clients upload the photos, my problem is to resize those image to sme size…without cropping the image in php. any help??

    # March 20, 2013 at 5:15 am

    You could use the CSS clip property: http://tympanus.net/codrops/2013/01/16/understanding-the-css-clip-property/

    # March 22, 2013 at 7:56 am

    Are you talking about thumbnail re size or the actual image? There are basic options for cropping in the media area if that helps. Would reduce the image file size instead of scaling all of them down. Otherwise you can just put a max-width: ///px and have CSS scale them down. Or rather have the img { max-width: 100%; } and then the container be a max-width: 900px; or whatever, so when you resize the browser the images will still be responsive.

    At least I think thats how it would work.

    # March 22, 2013 at 4:09 pm

    If you’re asking how to literally make a new, resized image in PHP, look at [imagecopyresampled()](http://php.net/imagecopyresampled). It’s annoyingly complicated, so spend time studying it. It might be best to make sure you can get the examples working correctly before trying your own implementation.

    # March 24, 2013 at 12:28 am

    @HugoGiraudel: I dont think cliping the image will be a good idea here.
    @Jeager: yeah its thumbnail but in my case those are the same image just want to resize

    the thing is that, it will be easy if the image uploaded by client i.e of any size can adjust in the screen with small gap or no gap.

    # March 24, 2013 at 1:38 am

    I like this
    http://masonry.desandro.com/demos/images.html

    also the animation of this link is cool
    http://isotope.metafizzy.co/demos/layout-modes.html

    i want the image to be resized with max-width and max-height..ie with aspect ratio..
    any help??

    # March 25, 2013 at 11:53 pm

    There is a php script that I have used in the past that may do the trick. It’s easy to setup and from what I have read might be what you are looking for.

    https://github.com/lencioni/SLIR

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".