[PHP] Image Resize with LibGD

2007-05-08 Thread Christian Haensel

Good morning,

I am using imagecreatetruecolor() and imagecopyresampled() to resize 
oversized images and am overlaying them with an transparent PNG to add a 
watermark. That works just well for oversized images.


Now, let's say I have a small image and would like to stretch it by 50 to 
100% of its original size... I know there will be a loss of quality. But 
maybe someone out there has had to deal with the same before and knows the 
best way to do that?


Any suggestion would be very much appreciated :o)

Greetings from germany,

Chris

--
Chriatian Haensel
Fulltime WebSlave
http://www.chftp.com 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Resize with LibGD

2007-05-08 Thread Greg Donald

On 5/8/07, Christian Haensel [EMAIL PROTECTED] wrote:

Now, let's say I have a small image and would like to stretch it by 50 to
100% of its original size... I know there will be a loss of quality. But
maybe someone out there has had to deal with the same before and knows the
best way to do that?


Create a new image resource with imagecreatetruecolor(); then copy
your source image into it using imagecopyresampled(), adjusting your
size to whatever you need.


--
Greg Donald
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Resize with LibGD

2007-05-08 Thread Richard Lynch
On Tue, May 8, 2007 3:17 am, Christian Haensel wrote:
 I am using imagecreatetruecolor() and imagecopyresampled() to resize
 oversized images and am overlaying them with an transparent PNG to add
 a
 watermark. That works just well for oversized images.

 Now, let's say I have a small image and would like to stretch it by 50
 to
 100% of its original size... I know there will be a loss of quality.
 But
 maybe someone out there has had to deal with the same before and knows
 the
 best way to do that?

I suspect you'll never be totally happy with the result of stretching
an image...

You're basically attempting to re-construct lost pixel data that
simply isn't there...

In my limited experience, you're almost always better off just leaving
the image alone rather than expanding it.

You can make it bigger by framing it centered in a larger image of
transparent pixel border, and then your watermark will blot out huge
chunks of it, perhaps, but it will layout okay, and at least the bits
of image one can see aren't all chunky/ugly.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] image resize looks horrible..

2004-06-07 Thread Edward Peloke
Any ideas as to how I can fix this function???

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..


I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?

Thanks,
Eddie

Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.



function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(.,$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x  $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x  $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==){
$dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match(/png/,$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}


 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] image resize looks horrible..

2004-06-07 Thread Marek Kilimajer
Is $gd2 set right?
Edward Peloke wrote:
Any ideas as to how I can fix this function???
-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..
I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?
Thanks,
Eddie
Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.

function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(.,$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x  $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x  $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==){
$dst_img=ImageCreate($thumb_w,$thumb_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match(/png/,$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] image resize looks horrible..

2004-06-07 Thread Justin Patrin
Are you using gd2 or not? If you're not, that's probably your problem.
Edward Peloke wrote:
Any ideas as to how I can fix this function???
-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..
I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?
Thanks,
Eddie
Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.

function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(.,$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x  $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x  $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==){
$dst_img=ImageCreate($thumb_w,$thumb_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match(/png/,$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
paperCrane Justin Patrin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] image resize looks horrible..

2004-06-03 Thread Edward Peloke
I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?

Thanks,
Eddie

Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.



function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(.,$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x  $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x  $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==){
$dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match(/png/,$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}


 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] image resize problems

2004-06-02 Thread Edward Peloke
I have looked at several of the functions and tried a few tutorials online
but am not having much luck for some reason resizing images.  I have this
code which works fine but everytime I try to add some resizing code, I get
the error that the image is not a valid image resource.  I have even
hardcoded the values to an image I know exists and get the same error.  I
would like to resize the images on upload to 250 wide but nothing seems to
work.

$upload_dir = ../images/property_$id;
  //When REGISTERED_GLOBALS are off in php.ini
  $_POST= $HTTP_POST_VARS;
  $_GET = $HTTP_GET_VARS;

  //Upload the file
if($_GET['method'] == upload)
{

  $file_array = $HTTP_POST_FILES['file'];
  $_SESSION['message'] = ;
  $uploads = false;
  for($i = 0 ; $i  $files_to_upload; $i++)
  {
if($_FILES['file']['name'][$i])
{
  $uploads = true;
  if($_FILES['file']['name'][$i])
  {
$file_to_upload = $upload_dir./.$_FILES['file']['name'][$i];
$thisName=$_FILES['file']['name'][$i];
$sql-query(update properties set
main_thumb='$thisName' where id=$id and main_thumb is null);

move_uploaded_file($_FILES['file']['tmp_name'][$i],$file_to_upload);
chmod($file_to_upload,0777);
//  add image resize
  $_SESSION['message'] .= $_FILES['file']['name'][$i].
uploaded.br;
  }
}
  }
  if(!$uploads)  $_SESSION['message'] = No files selected!;
}

Thanks,
Eddie

 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image resize on upload

2004-02-25 Thread Will
Hello all,
I looked at the PHP manual and found a lot of things to do with images 
but I did not seem to find out how to resize an image on upload.
Can anyone help??

Thanks in advance,
~WILL~
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Image resize with background.

2003-11-02 Thread Chris
Hey guys. I have read a lot of different option to resize images.
 
What about a script that will resize an image, constrain proportions,
and add a background color to whatever is left.
 
For example, I have a picture that is 600 (width) by 300 (height) and I
want to constrain proportions, and resize this to 300 by 400 (width by
height). There would be an extra 250 pixels left in the height, so now
that gets filled in with some background color.
 
This way, the people that have to make any image fit in a certain
location can keep the same aspect ratio, and not have to have an 'out of
place' image.
 
Just a though. What do you guys think?
 
-Chris 
[EMAIL PROTECTED]


RE: [PHP] Image resize with background.

2003-11-02 Thread Martin Towell
try the resize copy function (can't remember the exact name ATM)

Set the destination's first colour to the desired background colour, then
copy/resize the image to it.

Martin

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Monday, 3 November 2003 12:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Image resize with background.


Hey guys. I have read a lot of different option to resize images.
 
What about a script that will resize an image, constrain proportions,
and add a background color to whatever is left.
 
For example, I have a picture that is 600 (width) by 300 (height) and I
want to constrain proportions, and resize this to 300 by 400 (width by
height). There would be an extra 250 pixels left in the height, so now
that gets filled in with some background color.
 
This way, the people that have to make any image fit in a certain
location can keep the same aspect ratio, and not have to have an 'out of
place' image.
 
Just a though. What do you guys think?
 
-Chris 
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image resize

2003-03-12 Thread Michael P. Carel
hi to all,

I have a problem here in image resizing, after the image has been resized
, the image has been discolorized. How can i  recreate the image with the
same resolution and color properties.

Here's the sample code from my class file:

 $origPic = ImageCreateFromJpeg( $this - iOrig[ 'tmp_name' ] );
 $this - iNew = ImageCreate($nWidth,$nHeight);
  ImageCopyResized($this - iNew, $origPic, 0, 0, 0, 0, $nWidth, $nHeight,
$width, $height);

Thanx in advance.



Mike


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image resize

2003-03-12 Thread Hugh Danaher
if your system suports the commands, try imagecreatetruecolor() instead of
imagecreate(),
and imagecopyresampled() instead of imagecopyresized(),
hope this helps,
Hugh

- Original Message -
From: Michael P. Carel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 3:23 PM
Subject: [PHP] Image resize


 hi to all,

 I have a problem here in image resizing, after the image has been resized
 , the image has been discolorized. How can i  recreate the image with the
 same resolution and color properties.

 Here's the sample code from my class file:

  $origPic = ImageCreateFromJpeg( $this - iOrig[ 'tmp_name' ] );
  $this - iNew = ImageCreate($nWidth,$nHeight);
   ImageCopyResized($this - iNew, $origPic, 0, 0, 0, 0, $nWidth, $nHeight,
 $width, $height);

 Thanx in advance.



 Mike


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image resize

2003-03-12 Thread Michael P. Carel
thanks its working fine now.
- Original Message -
From: Hugh Danaher [EMAIL PROTECTED]
To: Michael P. Carel [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 9:09 AM
Subject: Re: [PHP] Image resize


 if your system suports the commands, try imagecreatetruecolor() instead of
 imagecreate(),
 and imagecopyresampled() instead of imagecopyresized(),
 hope this helps,
 Hugh

 - Original Message -
 From: Michael P. Carel [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 3:23 PM
 Subject: [PHP] Image resize


  hi to all,
 
  I have a problem here in image resizing, after the image has been
resized
  , the image has been discolorized. How can i  recreate the image with
the
  same resolution and color properties.
 
  Here's the sample code from my class file:
 
   $origPic = ImageCreateFromJpeg( $this - iOrig[ 'tmp_name' ] );
   $this - iNew = ImageCreate($nWidth,$nHeight);
ImageCopyResized($this - iNew, $origPic, 0, 0, 0, 0, $nWidth,
$nHeight,
  $width, $height);
 
  Thanx in advance.
 
 
 
  Mike
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image Resize

2003-02-23 Thread Randum Ian
Hi guys,

Is it possible to resize an uploaded file to 10% of it's size and rename
it accordingly?

I have the filename for the full-size image as filename-WWWxHHH.jpg
where WWW is the width and HHH is the height.

I want the re-sized image to have the filename
filename-thumb-WWWxHHH.jpg where WWW is the resized width and HHH is
the resized height.

Does this make any sense, would it be possible automatically?

I am grateful for any help, Ian.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image resize with database

2002-12-16 Thread Steve Vernon
(PHP 4.23, GD 1.6.2 or higher)

Hiya,
I have code to place the picture in a database, and I normally shrink it
when the user requests a picture. What I would like it to change to is that
it should shrink or expand the picture to be 300 pixels wide and then place
it into the database. I thought the function below would work to do to
return a text resized version.

It does sort of works, but makes a picture where only part of it is the
picture (top part), the rest is blank.

Any help would be gr8!

THanks,

Steve


 function shrink_picture($tmp_name,$size,$name)
 {
  $result = ereg(.gif$,strtolower($name));

  if($result)
  {
   $img = imagecreatefromgif($tmp_name);

  }
  else
  {
   $img = imagecreatefromjpeg($tmp_name);
  }

  $width = imagesx($img);
  $height = imagesy($img);
  $new_height = abs(300.0 * ($height/$width));

  $new_img = imagecreate(300, $new_height );


imagecopyresized($new_img,$img,0,0,0,0,300,$new_height,imagesx($img),imagesy
($img));

  imagejpeg($new_img,$tmp_name.a,70);

  imagedestroy($new_img);
  imagedestroy($img);

  $data = addslashes(fread(fopen($tmp_name.a,r),$size));

  return $data;
 }


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Image resize

2002-10-13 Thread Christian Ista

Hello,

I have an image (selected via a form), I know the original size of this
picture 800x600. I'd like when I put the files in the database resize to
240x180, or 120x90. 

How do that ?


Bye



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] image-resize/convert

2001-04-19 Thread De Bodemschat

Hello,

I'm creating a bunch of photogalleries and wondering about the following:

- Is it possible to convert an image or a whole dir with images (jpg) to 60%
  of the original imagesize using php to automate this task?

I know the gd library is installed, but don't know if it supports jpg... And
what functions do I need to use?

gd-variables in phpinfo():
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
PNG Support enabled


Hope you people can help.
THanks,

Bart Verbeek


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] image-resize/convert

2001-04-19 Thread elias

Hi.

here is my GD report from PHPInfo()
gd
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
GIF Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

I think you don't have JPG enabled.
As for resizing images yes, you can do that, i wrote bunch of scripts that
does that for you.
Whenever you need them mail me although they will be on my page soon.

-elias
http://www.kameelah.org/eassoft


""De Bodemschat"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I'm creating a bunch of photogalleries and wondering about the following:

 - Is it possible to convert an image or a whole dir with images (jpg) to
60%
   of the original imagesize using php to automate this task?

 I know the gd library is installed, but don't know if it supports jpg...
And
 what functions do I need to use?
 
 gd-variables in phpinfo():
 GD Support enabled
 GD Version 1.6.2 or higher
 FreeType Support enabled
 FreeType Linkage with TTF library
 PNG Support enabled
 

 Hope you people can help.
 THanks,

 Bart Verbeek


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] image-resize/convert

2001-04-19 Thread Joe Stump

Again - if you have imagemagick installed email me and I'll email you my little
class that does this.

--Joe

On Thu, Apr 19, 2001 at 10:02:47AM +0200, De Bodemschat wrote:
 Hello,
 
 I'm creating a bunch of photogalleries and wondering about the following:
 
 - Is it possible to convert an image or a whole dir with images (jpg) to 60%
   of the original imagesize using php to automate this task?
 
 I know the gd library is installed, but don't know if it supports jpg... And
 what functions do I need to use?
 
 gd-variables in phpinfo():
 GD Support enabled
 GD Version 1.6.2 or higher
 FreeType Support enabled
 FreeType Linkage with TTF library
 PNG Support enabled
 
 
 Hope you people can help.
 THanks,
 
 Bart Verbeek
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] image-resize (thumbnail 150x150 code)

2001-04-19 Thread ..s.c.o.t.t..

this is what i use to scale down an arbitrary .GIF or .JPG
image to 150x150...

$image_name is the name of the original file that you want
to create a thumbnail of...


function save_thumb($image_name,$image_type) {
  global $Svar;

$new_w = 150;
$new_h = 150;

$image_path = "/path/of/imagedir/". $image_name;
$thumb_path = "/path/of/thumbdir/" . $image_name;

if ($image_type == "image/pjpeg") {
$src_img = imagecreatefromjpeg($image_path);
}
elseif($image_type == "image/gif") {
$src_img = imagecreatefromgif($image_path);
}

$dst_img = imagecreate($new_w,$new_h);


imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($s
rc_img));

imagejpeg($dst_img, $thumb_path . "_t.jpg");

  return 1;
}




 -Original Message-
 From: Joe Stump [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 19, 2001 17:18
 To: De Bodemschat
 Cc: Php-General-list
 Subject: Re: [PHP] image-resize/convert


 Again - if you have imagemagick installed email me and I'll email you my little
 class that does this.

 --Joe

 On Thu, Apr 19, 2001 at 10:02:47AM +0200, De Bodemschat wrote:
  Hello,
 
  I'm creating a bunch of photogalleries and wondering about the following:
 
  - Is it possible to convert an image or a whole dir with images (jpg) to 60%
of the original imagesize using php to automate this task?
 
  I know the gd library is installed, but don't know if it supports jpg... And
  what functions do I need to use?
  
  gd-variables in phpinfo():
  GD Support enabled
  GD Version 1.6.2 or higher
  FreeType Support enabled
  FreeType Linkage with TTF library
  PNG Support enabled
  
 
  Hope you people can help.
  THanks,
 
  Bart Verbeek
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


 /* Joe Stump
  * Sr. PHP Developer
  * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
  */


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] image resize

2001-03-08 Thread PeterOblivion

My goal.. 
Take an image (gif,jpg) from a remote server, resize it into 200x150 and then 
save it on my local server.
My friend gave me a premade script but that doesnt work. Anyone have 
something like this already done or know where to find it?

- Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]