Jump to content


Photo

display correct picture


  • Please log in to reply
3 replies to this topic

#1 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 24 July 2006 - 01:10 PM

On a portion of my site the user is able to crop the images to liking, but the cropped image stays when trying to recrop the same image, but when I press the refresh button the newly cropped image replaces the previous cropped image.  How do I fix this? 

Jay.

Thanks a lot for the help.

#2 ChaosXero

ChaosXero
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 24 July 2006 - 01:12 PM

I have no idea because I cant give you a solution with no code...  Post any signifigant code and then we'll try to help.  I promise! (Comments in your code help too!)

#3 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 24 July 2006 - 01:24 PM

The process works in such, that when the user decides to crop an image, it gets stored in tmp.  The cropped image is displayed, where they have the choice of either NEW IMAGE, RECROP, SUBMIT

Here is the code for recrop selection
if ($_POST['recrop']) {
	unset($display);
	unset($image);
	
             //Path to image
             $imgfile=$_REQUEST['display'];
	
             //Image Name
             $image=$_REQUEST['imgfile'];
	
             //Delete cropped image
             unlink($imgfile);
}

//If Image name found get Original Image
if($image != "") $display="userImages/$username/largeVersion/".$image;

//goto image crop html page
include_once( "HTML/createProfileImage.html" )


So the original cropped image gets deleted from the file system, this has been proved, but after the second recrop of the image the original still displays until the refresh button is pushed.

If there is any more code you want to see just let me know.

Thanks

Jay



#4 ChaosXero

ChaosXero
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 24 July 2006 - 02:32 PM

You could force a refresh w/ a header(location: yoursite).  Otherwise... I'm not sure.  The image will stay until it is reloaded.  You could use Jscript to refresh it (an AJAX type effect).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users