Ask a Question related to PHP Development, Design and Development.
-
Juz #1
Re: Create Thumbnail
If you can use GD2 library use this function
function create_resampled_image($max_height, $max_width, $image_quality,
$image, $newimage){
$src_img = imagecreatefromjpeg($image);
$orig_x = imagesx($src_img);
$orig_y = imagesy($src_img);
$new_y = $max_height;
$new_x = $orig_x/($orig_y/$max_height);
if ($new_x > $max_width) {
$new_x = $max_width;
$new_y = $orig_y/($orig_x/$max_width);
}
$dst_img = imagecreatetruecolor($new_x,$new_y);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_x, $new_y, $orig_x,
$orig_y);
imagejpeg($dst_img, $newimage, $image_quality);
imagedestroy($src_img);
imagedestroy($dst_img);
}
Juz Guest
-
[PHP] PDF Thumbnail with PHP?
Unfortunatly, that's not what I'm trying to do. That function will add an image to a PDF file as a thumbnail. What I want to do, is read a PDF... -
for to create thumbnail by imagemagick gd netpbm ?
for to resize and copy original photos into a new directory and to use for a thumbnail gallery on the web; who is better GD, Netpbm or... -
Image::Magick::Thumbnail::create problem
I am using a script based on the example from www.cpan.org for Image::Magick::Thumbnail:- #!/usr/bin/perl -w use CGI qw(:all); print header;... -
any easy library to create a thumbnail
Hi all, I am trying to convert my gifs and png to thumbnails Does anyone know a library that can help me Thanks Ram -
PDF Thumbnail with PHP?
Does anyone know if there is a way to generate a thumbnail of the 1st page of a PDF document using PHP. I have an application that archives PDF... -
Guillaume JANY #2
Re: Create Thumbnail
replace line $dst_img = imagecreate($new_w,$new_h);> I'm looking for exactly the following script
> [url]http://alt-php-faq.org/local/105/[/url].
> But the quality of the result is horrible.
with line $dst_img = imagecreatetruecolor($new_w,$new_h);
you may also build a x2 thumbnail
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w* 2,$new_h*2,imagesx($src_im
g),imagesy($src_img));
and display it with width=$new_w, height=$new_h
Guillaume
[url]www.designerspace.com[/url]
Guillaume JANY Guest
-
s a n j a y #3
Re: Create Thumbnail
I have written a script for a commercial website to resize images. If you
still want it email me at [email]ski_sanjay@yahoo.com[/email]
sanjay
"Thür Thomas" <thomasFUCKK@SSPAMMMthuer.com> wrote in message
news:3f0c927e$0$22092$5402220f@news.sunrise.ch...> Hello NG
>
> I'm looking for exactly the following script
> [url]http://alt-php-faq.org/local/105/[/url].
> But the quality of the result is horrible.
> The original pic: [url]http://www.neonthaler.ch/test/moose.jpg[/url]
> The small pic: [url]http://www.neonthaler.ch/test/moose2.jpg[/url]
>
> Has someone a script with the same function and better results?
>
> Thx for your help.
> Thomas
>
>
s a n j a y Guest



Reply With Quote

