[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 06-28-2005, 03:18 PM   #1 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold


[Request] Fancy image uploading script

Hey guys,

I would really appreciate some help if someone could write me a script that does the following (unless maybe there is already a script out there somewhere - erm, and please don't say "did you check Hotscripts!?!?!?" or possibly someone here already wrote a script like this).

Anyways, the script I need is for an image uploader.
When you upload the image, I would like the script to slap a specified watermark image on it, in the bottom right hand corner of the uploaded image.

And then the image you uploaded to begin with, will now be uploaded onto the server, plus it will have a specified watermark on the bottom right of it.

After the uploading is finished, the script would then automatically generate a 100x100 (pixel) sized thumbnail of the uploaded image.

It then would provide a quick copy and paste code (like in a textarea box, or something the user can quickly select and copy). The copy and paste code would be the code for the thumbnail image to be shown and link in a new window to the original image (e.g. <a href="image_large.jpg" target="_blank"><img src="image_thumbnail.gif" border="0"></a>)

Is this possible?
I know it's long, but gees, it would help so much.

Please let me know - maybe one of you already wrote something like this, or could write it and give it out publically as you can see how handy it would be;
Thanks,
Andy
Ringr is offline  
Old 06-28-2005, 03:57 PM   #2 (permalink)
NamePros Regular
 
gamex's Avatar
 
Join Date: Feb 2004
Location: Student @ UConn
Posts: 408
73.95 NP$ (Donate)

gamex has a spectacular aura aboutgamex has a spectacular aura about


Hey, have you checked out hotscripts.com at all??

Hehe, j/k, I have a script on my website that adds a watermark to an image and also creates a thumbnail.

This is the script I use to create the thumbnail:

PHP Code:
function image_createthumb($src,$dest,$maxWidth,$maxHeight,$quality) {
                if (
file_exists($src)  && isset($dest)) {
                    
// path info
                    
$destInfo  = pathInfo($dest);
                    
                    
// image src size
                    
$srcSize   = getImageSize($src);
                       
                    
// image dest size $destSize[0] = width, $destSize[1] = height
                    
$srcRatio  = $srcSize[0]/$srcSize[1]; // width/height ratio
                    
$destRatio = $maxWidth/$maxHeight;
                    if (
$destRatio > $srcRatio) {
                        
$destSize[1] = $maxHeight;
                        
$destSize[0] = $maxHeight*$srcRatio;
                    }
                    else {
                        
$destSize[0] = $maxWidth;
                        
$destSize[1] = $maxWidth/$srcRatio;
                    }
                    
                    
// path rectification
                    
if ($destInfo['extension'] == "gif") {
                        
$dest = substr_replace($dest, 'jpg', -3);
                    }
                    
                    
// true color image, with anti-aliasing
                    
$destImage = imagecreatetruecolor($destSize[0],$destSize[1]);
                    
imageantialias($destImage,true);
                    
                    
// src image
                    
switch ($srcSize[2]) {
                        case
1: //GIF
                        
$srcImage = imagecreatefromgif($src);
                        break;
                        
                        case
2: //JPEG
                        
$srcImage = imagecreatefromjpeg($src);
                        break;
                        
                        case
3: //PNG
                        
$srcImage = imagecreatefrompng($src);
                        break;
                        
                        default:
                        return
false;
                        break;
                    }
                    
                    
// resampling
                    
imagecopyresampled($destImage, $srcImage, 0, 0, 0, 0,$destSize[0],$destSize[1],$srcSize[0],$srcSize[1]);
                    
                    
// generating image
                    
switch ($srcSize[2]) {
                        case
1:
                        case
2:
                        
imagejpeg($destImage,$dest,$quality);
                        break;
                        
                        case
3:
                        
imagepng($destImage,$dest);
                        break;
                    }
                    return
true;
                }
                else {
                    return
false;
                }
            }
            
image_createthumb($src,$dest,$wth,$hgt,$quality);
I cant remember if I modified this at all, so let me know if you have any problems.

The script I used for watermarking (I actually used this to add a rounded border to all of my images) can be found here:

http://www.phpgeek.com/articles.php?content_id=6
__________________
Joe
CarrotCash.com
gamex is offline  
Old 06-28-2005, 05:47 PM   #3 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold


Hey Gamex,

Thanks a bunch for getting back to me.
I hate to say it, but I know nothing about PHP really, well I mean - the language itself. How exactly would I go about using this script? Would the coding you provided simply go in my "uploader.php" which would then be used as the "action" (action="uploader.php") in the form?

Sorry I am so dull at this,
-Andy M
Ringr is offline  
Old 06-28-2005, 10:19 PM   #4 (permalink)
Account Suspended
 
Join Date: May 2005
Location: Earth
Posts: 178
153.00 NP$ (Donate)

mosaic is an unknown quantity at this point


Also you can try image host scripts as photopost pro and arbinator.
mosaic is offline  
Old 07-04-2005, 06:30 PM   #5 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold


Meh, I'm still confused on how I can get it to work.
:$
Ringr is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Keywords? spy69 Search Engines 5 06-28-2005 08:05 PM
Image hosting script for sale axilant Scripts For Sale 19 12-28-2004 10:20 AM
60.000 Templates, scripts, fonts, banners etc. $9.95 atkims Web Development Wanted 19 11-16-2004 09:48 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 11:00 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85