Smart Image Processor PHP 2 Support Product Page

This topic is locked
Answered

SIP not working

Asked 26 May 2011 05:37:32
1
has this question
26 May 2011 05:37:32 Vernon Davis posted:
I've tried for the past 5 days researching these forums and to no luck with having the SIP and PPU to work. I'm using DW CS5.

Here is a simple form with just a file field and a submit button but it still does not resize the image. The file upload works correctly but that is it. Thanks. I've tried the server behaviors in order as mentioned in another forum as well.


<?php require_once('ScriptLibrary/incPureUpload.php'); ?>
<?php require_once('ScriptLibrary/cGraphicMediator.php'); ?>
<?php
// Pure PHP Upload 2.1.11
$ppu = new pureFileUpload();
$ppu->path = "images/event_photos";
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu->formName = "form1";
$ppu->storeType = "file";
$ppu->sizeLimit = "";
$ppu->nameConflict = "uniq";
$ppu->nameToLower = true;
$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 = "events.php";
$ppu->checkVersion("2.1.11";
$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
// 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(200, 200, true);
$sipp2->overwrite = true;
$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>Untitled Document</title>
<script language='JavaScript' src='ScriptLibrary/incPureUpload.js' type="text/javascript"></script>
</head>

<body>
<form method="post" enctype="multipart/form-data" name="form1" onsubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','','','','','');return document.MM_returnValue">
Image:
<input name="fileField" type="file" id="fileField" onchange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','','','','','')"/>
<input type="submit" name="button" id="button" value="Submit" />
</form>
</body>
</html>

Replies

Replied 26 May 2011 09:23:59
26 May 2011 09:23:59 Teodor Kuduschiev replied:
Hello Vernon,

Please remove the redirection you've set in Pure PHP Upload and try to upload an image again.
Replied 26 May 2011 14:18:50
26 May 2011 14:18:50 Vernon Davis replied:
Hello Teodor,

Thanks for your quick reply. I removed the redirect URL so that my code now shows.

$ppu->redirectURL = "";

For some reason the Smart Image Processor is not resizing my images. The initial file is being uploaded to the server but I was trying to have the same image resized and added to the server with "thumb_" in front of the smaller resized image. When I used this PPU and SIP a fews ago on a different site it worked so I'm familiar with it. Thanks!
Replied 31 May 2011 16:19:30
31 May 2011 16:19:30 Miroslav Zografski replied:
Hello Vernon,

A follow up from the chat with you:

Problem was the low set of the memory_limit value in the PHP.ini file.
Possible solutions:
Access the PHP.ini and increase the memory_limi.
set following line in the head of the page where the upload and SIP resides :
<?php ini_set('memory_limit','128M');?>


Regards,
Replied 05 Jun 2011 01:07:24
05 Jun 2011 01:07:24 Vernon Davis replied:
Correct, thanks a lot for the live support. That solved the problem.

Reply to this topic