473,748 Members | 2,470 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image RESIZER SOMBODY PLEASE HELP

1 New Member
ImageResizer.ph p

Image Resizer PLEASE HELP
The URL of the page this is on in my site is http://poppa-pimps-wallpapers.com//ImageResizer.php You can click on browse and get image,but when you upload image it will go to another page and says [b]((unable to create emp directory)) Here is a site to be able to see script actually work http://tech.tailoredweb.com/image-editor-52/ and can be DL from there also. I am using FP 2003 and geocities pro Domain site.
Poppa

The script is as follows

[PHP]
<?
session_start() ;

$refresh=$_SESS ION["REFRESHED"]=($_SESSION["REFRESHED"])?0:1;

$imgsrc = ($_REQUEST["imgsrc"])?
$_REQUEST["imgsrc"]: "sample.jpg ";

if (strpos($imgsrc ,"sample.jpg")> 0)
$imgfile = "sample.jpg ";
else
$imgfile = substr($imgsrc, strpos($imgsrc, "/img_edt"));

$__min=base64_d ecode("RGV2ZWxv cGVkIEJ5IDxhIGl kPSJfX2tpbSIgaH JlZj0iaHR0cDovL 3RlY2guY2l0eXBv c3QuY2EiPkNpdHl Qb3N0LmNhPC9hPg ==")
?>

<html>
<head>
<style>
img {border:none;}
body,table,td {font-family:Arial;fo nt-size:12px}
form {display:inline ;}
</style>
<title>Image Cropper / Resizer</title>
<script>
var isIE = (document.all)? true:false;
var minHeight=40, minWidth=40;

var canvasEl, imageEl, selector;
var oldX, oldY;
var mouseMoved;

document.onmous edown = mouseDown;
document.onmous emove = mouseMove;
document.onmous eup = mouseUp;

//------------ FUNCTIONS FOR DRAG AND DROP ----------------------------
//------------- mouseDown, mouseMove, mouseUp, --------------
//------------- grabEl, moveEl, dropEl --------------
function mouseDown(e) {
e = (!e)? window.event : e ;

var targetEl = (isIE)? e.srcElement : e.target;

while (targetEl.id != "image") {
targetEl = targetEl.parent Node;
if (targetEl == null) { return }
}

if (targetEl.id==" image") {
canvasEl = document.getEle mentById("canva s");
imageEl = document.getEle mentById("image ");
selector = document.getEle mentById("selec tor");
oldX = (e.clientX + document.body.s crollLeft);
oldY = (e.clientY + document.body.s crollTop);
mouseMoved=fals e;
}
else
imageEl == null;

if (isIE)
e.returnValue = false;
else
e.preventDefaul t();
}

function mouseMove(e) {
e = (!e)? window.event : e ;
if (imageEl == null) { return };

mouseMoved = true;
var imageW = parseInt(imageE l.width, 10 );
var imageH = parseInt(imageE l.height, 10 );

var newX = (e.clientX + document.body.s crollLeft );
var newY = (e.clientY + document.body.s crollTop );

var x = oldX+canvasEl.s crollLeft-parseInt(canvas El.style.left,1 0);
var y = oldY+canvasEl.s crollTop-parseInt(canvas El.style.top,10 );
var w = (newX - oldX);
var h = (newY - oldY);

w = Math.min( w, (imageW-x));
h = Math.min( h, (imageH-y));
w = Math.max( w, 1);
h = Math.max( h, 1);

selector.style. display = "block";
selector.style. width = w + "px";
selector.style. height = h + "px";
selector.style. left = x + "px";
selector.style. top = y + "px";
document.getEle mentById("crop" ).disabled = false;

document.resize frm.width.value = w;
document.resize frm.height.valu e = h;

document.cropfr m.x.value = x;
document.cropfr m.y.value = y;
document.cropfr m.w.value = w;
document.cropfr m.h.value = h;

if (isIE)
e.returnValue = false;
else
e.preventDefaul t();

}

function mouseUp(e) {
imageEl = null;
if (mouseMoved==fa lse) {
selector.style. display = "none";
document.getEle mentById("crop" ).disabled = true;
}
}

function init() {
if (<?=$refresh?> )
window.location .reload();
var kim = document.getEle mentById('__kim ');
if (kim==null || kim.tagName != "A" || kim.innerHTML<= "" ) {
alert("This Image-Editor Version Requires Link To CityPost.ca");
return false;
}
}
</script>

</head>
<body onload="init()" >
<div id="canvas" style="position :absolute;top:5 px;left:5px;wid th:800px;height :590px;border:1 px solid black;overflow: auto;">
<div id="selector" style="display: none;position:a bsolute;border: 1px solid blue;font-size:1px;"></div>
<img id="image" src="<?=$imgsrc ?>" />
</div>

<div style="position :absolute;top:5 px;left:810px">

<b>HOW TO? 1-2-3</b>
<br><br><b>1. Upload Your Image </b>
<br><font color=blue><?=$ _REQUEST["m1"]?></font>
<form method=post action="proc_im age_editor.php" ENCTYPE="multip art/form-data">
<input type=file name=imgfile size=10/>
<button type=submit name="upload">U pload Image</button>
</form>

<br><br><b>2. Resize or Crop</b>
<form name=resizefrm method=post action="proc_im age_editor.php" >
<br>&nbsp; - Drag mouse or type numbers

<table cellpadding=0 cellspacing=0>
<tr><td colspan=4>
<font color=blue><?=$ _REQUEST["m2"]?></font>
<tr>
<td>w:<td><inpu t id="width" name="width" size=1/>
<td>h:<td><inpu t id="height" name="height" size=1/><br>
<tr><td><td colspan=3>
<input type="hidden" id="imgfile" name="imgfile" value="<?=$imgf ile?>" />
<button type=submit id="resize" name="resize" value="1">
&nbsp; &nbsp; &nbsp; Resize &nbsp; &nbsp;&nbsp; </button>
</table>
</form>

<form name=cropfrm method=post action="proc_im age_editor.php" >
<table cellpadding=0 cellspacing=0>
<tr><td colspan=4>
<font color=blue><?=$ _REQUEST["m3"]?></font>
<tr>
<td>x: <td><input name="x" id="x" size=1 readonly>
<td>y: <td><input name="y" id="y" size=1 readonly>
<tr>
<td>w: <td><input name="w" id="w" size=1 readonly>
<td>h: <td><input name="h" id="h" size=1 readonly>
<tr><td><td colspan=3>
<input type="hidden" id="imgfile" name="imgfile" value="<?=$imgf ile?>" />
<button type=submit id="crop" name="crop" value="1" disabled>
Crop Selection</button>
</table>
</form>

<? if ($imgsrc!=="sam ple.jpg") { ?>
<br><b>3. Save </b>
<br><button
onclick="window .location.href= 'proc_download. php?fl=<?=$imgs rc?>'">
Download Image
</button>

<br><br><b>4. Go Back </b>
<font color=blue><?=$ _REQUEST["m4"]?></font>
<form action="proc_im age_editor.php" >
<input type="hidden" id="imgfile" name="imgfile" value="<?=$imgf ile?>" />
<button type=submit id="recall" name="recall" value="1">
Recall Original
</button>
</form>
<? }?>

<br>Image url : <?=$imgfile?>
<br>
<br><?=$__min ?>
<br><?include "/var/www/tech/_google_180_150 .inc"?>
</div>
(/PHP/>
</body>
[/PHP]
Dec 13 '06 #1
2 2364
steven
143 New Member
The problem isn't with your resize script, it's with your upload script / php config. Have you specified a temp directory in your php.ini and if not, do you have the relevent permissions to write to the systems default temp directory?

You can create your own directory and set it as the temp for php, if that helps.
Dec 14 '06 #2
b1randon
171 Recognized Expert New Member
The problem isn't with your resize script, it's with your upload script / php config. Have you specified a temp directory in your php.ini and if not, do you have the relevent permissions to write to the systems default temp directory?

You can create your own directory and set it as the temp for php, if that helps.
For sure. I'd recommend making your own directory too since it isn't very likely that geocities is going to bend over backward to give the account php is running under permissions for folders outside your root in their tree.
Dec 14 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3019
by: vunet.us | last post by:
Hello, What is the best image resizing tool is out there? I want to resize images in ASP page when users upload them into some directory. Your recommendations are super welcome. Thank you.
2
2455
by: Michael | last post by:
Hi. I need code that simply resize image with same ratio. My server has ASPImage 1.5 component. Other techniques is appreciated. Michael
2
1706
by: vunet.us | last post by:
I have been using Imager Resizer (http://www.crazybeavers.se/products_imagerresizer.asp) DLL component to handle all my image resizing on server side and delivering a custom-size image to the clients. This component does not always work well (or works well every other time only). Is there any proven way of to handle the image resizing anyone knows? I mean the one YOU used and it perfectly worked for you.
1
1161
by: vovan | last post by:
I need to make my VB 2005 Windows Form application resolution independent. I bought Klik resizer control. But it doesn't work with some Infragistics controls properly. Can anyone suggest any other resizer control. I googled and found nothing Thank you vovan
1
1744
by: VUNETdotUS | last post by:
Please, recommend me a good free image resizing tool you've been successfully using up to this date in ASP or ASP.NET. Thanks.
1
1743
by: hemant kamble | last post by:
Hi all, I am hemant , I am new for VB. Can sombody help to access serial port in VB on windows XP. I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial port on XP. Thanks.
0
1063
by: hemant kamble | last post by:
Hi all, I am hemant , I am new for VB. Can sombody help to access serial port in VB on windows XP. I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial port on XP. Thanks
9
1878
by: Tony Sosa | last post by:
Does anyone know what kind of tweaks I need to make to pertinent configs to render an image correctly? Right now, the text of the argument passed to imagejpeg is being shown instead of the image itself. Here's the code. This used to succeed until my hosting provider changed something on his end. Now he's struggling to restore the functionality that used to work. <?php
0
9555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.