| | |
Making thumbnails in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello,
I want to convert a 1024 x 786 wallpaper into thumbnail in PHP
Wots the code for it?
Thanx in advance
I want to convert a 1024 x 786 wallpaper into thumbnail in PHP
Wots the code for it?
Thanx in advance
Try something like this:
This creates a 100x100 Pixel Thumbnail. Make sure, depending on your version of PHP, that the GD library is installed.
Michael
PHP Syntax (Toggle Plain Text)
$size = getimagesize ("path_to_original_image"); $mini = imagecreatetruecolor(100,100); $orig = imagecreatefromjpeg ("path_to_original_image"); imagecopyresampled ($mini, $orig, 0, 0, 0, 0, 100, 100, $size[0], $size[1]); imagejpeg ($mini, "path_to_thumbnail/thumbnail.jpg", 100);
This creates a 100x100 Pixel Thumbnail. Make sure, depending on your version of PHP, that the GD library is installed.
Michael
![]() |
Similar Threads
- PHP parsing error, unexpected '<' (PHP)
- php loading (PHP)
- Automatic email creation in cpanel ----PHP (PHP)
- Help with making a survey form (HTML and CSS)
- Apache and PHP (PHP)
- IIS & PHP configuration-PHP.ini instructions ignored (Windows Servers and IIS)
- PHP image resize issue. (PHP)
Other Threads in the PHP Forum
- Previous Thread: hello i need help please
- Next Thread: PHP includes & variables
Views: 1434 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube





