[eluser]Unknown[/eluser]
Hi i have some problem with Jcop.
When there is parameter in the url, it wont crop. How to solve this?
Status:
Can crop when there is no parameter. Image source is static, not from the function.
see attachment 1
Problem:
Cant crop image when there is url parameter. Image source come from the function.
see attachment 2
controller
Code:
function cropimage($filename)
{
//$data['filename'] = $filename;
$data['imageurl'] = "uploads/images/$filename";
$this->load->view('cropimages', $data); //cropimage
}
view
Code:
<html>
<head>
[removed][removed]
[removed][removed]
<link rel="stylesheet" href="../css/jquery.Jcrop.css" type="text/css" />
<link rel="stylesheet" href="demo_files/demos.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css" />
[removed]
// Remember to invoke within jQuery(window).load(...)
// If you don't, Jcrop may not initialize properly
jQuery(document).ready(function(){
jQuery('#cropbox').Jcrop({
onChange: showCoords,
onSelect: showCoords
});
});
// Our simple event handler, called from onChange and onSelect
// event handlers, as per the Jcrop invocation above
function showCoords(c)
{
jQuery('#x').val(c.x);
jQuery('#y').val(c.y);
jQuery('#x2').val(c.x2);
jQuery('#y2').val(c.y2);
jQuery('#w').val(c.w);
jQuery('#h').val(c.h);
};
[removed]
</head>
<body>
<div id="outer">
<div class="jcExample">
<div class="article">
<h1 align="center">Crop Image</h1>
<?php echo @$error; ?>
<?php echo form_open('image/do_cropimage'); ?>
<div align="center">
<label>X1 <input type="text" size="4" id="x" name="x" /></label>
<label>Y1 <input type="text" size="4" id="y" name="y" /></label>
<label>W <input type="text" size="4" id="w" name="w" /></label>
<label>H <input type="text" size="4" id="h" name="h" /></label>
<input type="submit" value="Crop"/>
</div>
<?php echo form_close(); ?>
<!-- This is the image we're attaching Jcrop to -->
<div align="center">
<img src="<?php echo base_url(); ?><?php echo $imageurl; ?>" id="cropbox" />
</div>
<!-- This is the form that our event handler fills -->
</div>
</div>
</div>
</body>
</html>