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?

Link to comment
Share on other sites

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);
?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.