Jump to content

(And yet still another) Question about image resize and thumbnails


DBookatay

Recommended Posts

I know this question has been asked over and over again, hence the title...

 

I am trying to find a script that will do 3 things:

 

  1.) Resize the image to 365x274 and upload it to a specified directory

  2.) Create a thumbnail of the same image at 90x45 and place it in a different directory

  3.) Rename both images, based on $_GET ($stock= $_GET[stock];)

 

I've found scripts that will upload images (and even created one), or/and make a thumbnail, or/and rename images, but nothing that will do all 3. Plus most of the thumbnail create scripts seems to strip a lot of colors out of the images, making them not as attractive.

 

Does anyone know a good place to look code examples, or have a good script in thier code library?

You can just do

 

/////////// THUMBNAIL
<img src="image.png" height="90" width="90" />
/////////// IMG
<img src="image.png" height="365" width="274" />

 

 

and for your other question

 

bool rename ( string $oldname , string $newname [, resource $context ] )

http://ca.php.net/rename

<?php

$new_name = $_GET['stock'];
rename("/tmp/tmp_file.txt", "/home/user/login/docs/".$new_name);
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.