How to make user images light weight in php ?

February 21, 2012 – 4:25 pm

I’m making a messaging system using php jquery.
When user post the message, his message scroll down with his profile image floating left side of his message(Just like facebook, when you post something, it scroll down with your picture).
But comparatively, my page is heavy then facebook due to images.
I want to ask that what can I do to make my page light weight too and how to make these images light weight?

Related posts:

  1. How would I diplay all images in a folder using PHP?
  2. How do I resize all of the images in a table in a php script?
  3. what is the mysql query to store images?
  4. Why are women frightened when they find out I use Linux and can squat nearly twice my weight?
  5. Help with displaying images written in Perl?
  6. Help with displaying images written in Perl?
  7. Help with displaying images written in Perl?
  8. Help with displaying images written in Perl?
  9. How do I tell PHP/MySql where to load my images?
  10. Perl/CGI displaying images
  1. One Response to “How to make user images light weight in php ?”

  2. There are a few options, but you will probably need to resize the images, which will need to be done either before you upload the image or immediately after upload.

    You can use something like GD or Imagick on the server to do it, as well as other php solutions. Otherwise, use a photo-editing software to scale the image before you upload it and make sure it is only as big as you need for the webpage.

    For images that you are using on thumbnails, you should always have a small sized image for the thumbnail and NOT use the full size image to display thumbnails.

    Otherwise, if you do not want to shrink the images to the required size, or it doesn’t work with your app, you can also only load one image to start with and only after the page is loaded, load the others.

    For example, with a slideshow, you can load the first image and then use jquery’s document ready function to load the rest of the images. This way, the page loads completely first and then the rest of the images are loaded.

    Probably a combination of loading images smartly via javascript after the page loads and sizing them correctly will be best.

    By Jacob on Feb 21, 2012

Sorry, comments for this entry are closed at this time.