Zip Processor PHP 3 Support Product Page

applying smart image processor to a zipped folder

Asked 14 Dec 2010 08:36:01
1
has this question
14 Dec 2010 08:36:01 Phil Boyle posted:
I'm sure I saw a tutorial the other day for applying smart image processor to a zipped folder and thought that's great I'll can use that in a couple of days time. Didn't bookmark it. Now can't find it. Does it exist or was I dreaming?
Phil

Replies

Replied 17 Dec 2010 01:23:40
17 Dec 2010 01:23:40 Phil Boyle replied:
Hi guys
Don't want to be a pain but is this possible. I tried it, it worked but produced a whole heap of error messages.
Thanks
Phil
Replied 22 Dec 2010 12:01:57
22 Dec 2010 12:01:57 Miroslav Zografski replied:
Hello Phil,

Please, pass here the error messages you got, as well as description of the set up.

Regards,
Replied 23 Dec 2010 21:33:51
23 Dec 2010 21:33:51 Phil Boyle replied:
These are the error messages:

Notice: Undefined variable: file in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\DMXZip.lib.php on line 329

Notice: Trying to get property of non-object in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\DMXZip.lib.php on line 329
This function is not callable:
This function is not callable:

Notice: Undefined index: width in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1134

Notice: Undefined index: height in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1135

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1140

Warning: imagealphablending(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1143

Warning: imagealphablending(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1144

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1150

Warning: imagefill(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1152

Warning: imagecopy(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1155

Warning: imagejpeg(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1158

Warning: imagedestroy(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1161

Warning: imagealphablending(): supplied argument is not a valid Image resource in C:\HostingSpaces\RW\rochellewithell.co.nz\wwwroot\ScriptLibrary\lib\cImageEditor\cGD2ImageEditor.php on line 1163
This function is not callable:
This function is not callable:

The page code is this :

<?php require_once('../ScriptLibrary/incPureUpload.php'); ?>
<?php require_once('../ScriptLibrary/DMXZip.lib.php'); ?>
<?php require_once('../ScriptLibrary/cGraphicMediator.php'); ?><?php
// Pure PHP Upload 2.1.10
$ppu = new pureFileUpload();
$ppu->path = "gallery";
$ppu->extensions = "";
$ppu->formName = "form1";
$ppu->storeType = "file";
$ppu->sizeLimit = "";
$ppu->nameConflict = "over";
$ppu->requireUpload = "false";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "600";
$ppu->progressBar = "";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->redirectURL = "";
$ppu->checkVersion("2.1.10";
$ppu->doUpload();

if (isset($editFormAction)) {
if (isset($_SERVER['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $_SERVER['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
?>
<?php
// FileZip Processor 3.0.3
$zip1 = new ZipProcessor;
$zip1->scriptFolder = "../ScriptLibrary";
$zip1->source = "upload";
$zip1->overwrite = true;
$zip1->action = "unzip";
$zip1->comment = "\n ";
$zip1->uploadFolder = "gallery";
$zip1->extractUnique = true;
$zip1->deleteAfterUnzip = true;
$zip1->defaultFile = "";
$zip1->uploadFields = "";
$zip1->ProcessFiles($ppu);
?>
<?php
// Smart Image Processor PHP 2.0.7
if (isset($_GET['GP_upload'])) {
$sipp2 = new cGraphicMediator("upload", $ppu, "";
$sipp2->setComponent("Auto";
$sipp2->setMatteColor("#FFFFFF";
$sipp2->resize(100, 100, true);
$sipp2->overwrite = false;
$sipp2->setMask("##path##thumb_##name##.jpg";
$sipp2->saveJPEG(80);
$sipp2->process();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zipp and sipp folder upload test</title>
<script language='JavaScript' src='../ScriptLibrary/incPureUpload.js' type="text/javascript"></script>

</head>

<body>
<form action="<?php echo $GP_uploadAction; ?>" method="post" enctype="multipart/form-data" name="form1" onsubmit="checkFileUpload(this,'',false,'','','','','','','');return document.MM_returnValue">
<input name="file1" type="file" onchange="checkOneFileUpload(this,'',false,'','','','','','','')"><br/>
<input type="submit" value="Upload">
</form>
</body>
</html>
What I want it to do is upload to folder 'gallery' and create a folder using the name of the zipped folder and resizing the images and creating thumbnails.

It does it all except creates those errors at the start of this reply and also adds an extra folder. So instead of getting a path that is 'gallery/name of zipped folder' I get 'gallery/name of zipped folder/gallery'.

Your help is appreciated.
Phil
Replied 08 Feb 2011 02:29:32
08 Feb 2011 02:29:32 Phil Boyle replied:
Any news on my problem.
Thanks
Replied 08 Feb 2011 17:44:57
08 Feb 2011 17:44:57 Miroslav Zografski replied:
Hello Phil,

you need to separate the sip from the rest of the code by placing it on a second page. So once you upload the zip and it is unzipped in yous folder you redirect to the page where the sip is and pass to it the folder that it should process. This is done in the UI of the SIP. You can pass it as a variable as well as a certain folder. but you must be sure that you have separated it from the rest of the server behaviors.

Regards,
Replied 08 Feb 2011 23:52:45
08 Feb 2011 23:52:45 Phil Boyle replied:
Thanks. I'll give it a go.
Replied 09 Feb 2011 10:41:19
09 Feb 2011 10:41:19 Miroslav Zografski replied:
Hello Phil,

I await your feedback.

Regards,

Reply to this topic