Jump to content

Archived

This topic is now archived and is closed to further replies.

crouchjay

display correct picture

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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!)

Share this post


Link to post
Share on other sites
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
[code]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" )
[/code]


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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.