Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Reduce the size of the png images

images php coding issues or problems here.

Moderators: macek, egami, gesf

Reduce the size of the png images

Postby renjini » Mon Jan 31, 2011 8:28 pm

How can i reduce the resolution of the png images in php ?
renjini
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon Jan 31, 2011 5:07 am

Re: Reduce the size of the png images

Postby webinfopedia » Fri Jun 10, 2011 3:59 am

Hi
for this read my article below
http://www.webinfopedia.com/create-thumbnail-image-dynamically-using-PHP.html

Hope this will help you
Thank You
User avatar
webinfopedia
New php-forum User
New php-forum User
 
Posts: 84
Joined: Sat May 21, 2011 10:26 pm

Re: Reduce the size of the png images

Postby Tacticious » Wed Jun 29, 2011 2:09 pm

I wouldn't recommend dynamically creating a NEW image, EVERY single time someone loads a page, for EVERY single image... That's INCREDIBLY inefficient, and on a website with traffic, it is very taxing.

It is much more efficient to make a script to simply generate a thumbnail for all your images, then display the static thumbnail. Generating the resized image on the fly does not save the end-user any bandwidth / download times, either. They still have two separate files they download, as technically your original and thumbnail are still two different images.

If you do want to use a script to link to in your image tags, make your script check a thumbnail directory for the image. If it exists, display it. If not, generate it, then throw it into the thumbnail directory as well. Leaving the script you linked in its current state is a bad idea, though. It works, and for a small website will be fine, but for a website with traffic you will want to reduce the amount of real-time dynamics as much as -possible. At the very least, with caching. Don't make your users suffer because you don't want to take the time to do it RIGHT and efficient. The less you do in your scripts, the more your users have to do / wait.
Tacticious
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon Jun 27, 2011 1:06 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.