Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
sonny  
#1 Posted : Saturday, September 15, 2007 5:26:16 AM(UTC)
sonny

Rank: Member

Groups: Member
Joined: 9/9/2006(UTC)
Posts: 22

Hi All,

I have one (640x480) jpg on the client which i have selected to upload. I take this one image and resize it and store it into different sizes and directories on the server.

For example, the resize are 640x480,320x240,160x120, and 100x72.

And here is the segment of code in the index.php

Code:
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "640");
iu.addParam("UploadThumbnail1Height", "640");
iu.addParam("UploadThumbnail1JpegQuality", "40");

iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "320");
iu.addParam("UploadThumbnail2Height", "320");
iu.addParam("UploadThumbnail2JpegQuality", "65");

iu.addParam("UploadThumbnail3FitMode", "Fit");
iu.addParam("UploadThumbnail3Width", "160");
iu.addParam("UploadThumbnail3Height", "160");
iu.addParam("UploadThumbnail3JpegQuality", "65");

iu.addParam("UploadThumbnail4FitMode", "Fit");
iu.addParam("UploadThumbnail4Width", "100");
iu.addParam("UploadThumbnail4Height", "100");
iu.addParam("UploadThumbnail4JpegQuality", "65");



And here is the segment of code in the upload.php file

Code:
        for ($i = 1; $i <= $fileCount; $i++)
        {
                $thumbnail1Field = "Thumbnail1_" . $i;
                if (!$_FILES[$thumbnail1Field]['size'])
                        return;
                $fileName = getSafeFileName(basename($_POST["FileName_" . $i]));
                move_uploaded_file($_FILES[$thumbnail1Field]['tmp_name'], $absThumbnailsPath640 . "/" . $fileName);

                $img .= $fileName . ",";

                $thumbnail2Field = "Thumbnail2_" . $i;
                if (!$_FILES[$thumbnail2Field]['size'])
                        return;
                $fileName = getSafeFileName(basename($_POST["FileName_" . $i]));
                move_uploaded_file($_FILES[$thumbnail2Field]['tmp_name'], $absThumbnailsPath320 . "/" . $fileName);

                $thumbnail3Field = "Thumbnail3_" . $i;
                if (!$_FILES[$thumbnail3Field]['size'])
                        return;
                $fileName = getSafeFileName(basename($_POST["FileName_" . $i]));
                move_uploaded_file($_FILES[$thumbnail3Field]['tmp_name'], $absThumbnailsPath160 . "/" . $fileName);

                $thumbnail4Field = "Thumbnail4_" . $i;
                if (!$_FILES[$thumbnail4Field]['size'])
                        return;
                $fileName = getSafeFileName(basename($_POST["FileName_" . $i]));
                move_uploaded_file($_FILES[$thumbnail4Field]['tmp_name'], $absThumbnailsPath100 . "/" . $fileName);
        }


Now if i just leave the thunmbnail1,2,3 it all works fine. Once i add thumbnail4 it still does the 1st 3, but not the last one. Is their a max limit of 3 or is this a configuration item i need to change. If so, which one.

Any help is much appreacited

Thanks in advance
Sonny

Edited by user Tuesday, February 12, 2008 12:57:55 PM(UTC)  | Reason: Not specified

thanks in advance,
Sonny
sonny  
#2 Posted : Saturday, September 15, 2007 5:38:55 AM(UTC)
sonny

Rank: Member

Groups: Member
Joined: 9/9/2006(UTC)
Posts: 22

Ok well after reading the documentation (should have read it first) Only 3 resizes are supported. There is another way to do it by using thumbnailadd. But im not sure what i need to to. Can someone help me provide some code or examples how thumbnailadd should look

thanks
Sonny
thanks in advance,
Sonny
sonny  
#3 Posted : Saturday, September 15, 2007 6:07:48 AM(UTC)
sonny

Rank: Member

Groups: Member
Joined: 9/9/2006(UTC)
Posts: 22

Never mind.. got it working.

regards,
Sonny
thanks in advance,
Sonny
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.