The browser displays original image instead of the cropped image until Refresh or Reload is clicked in the browser. This is because the same file name is used for both the original and cropped image. This is easily fixed by renaming the file after cropping in function cropUserPic_submit().

Comments

wzigg’s picture

Assigned: Unassigned » wzigg
wzigg’s picture

Assigned: wzigg » Unassigned

Add this to cropUserPic_submit():

       $src = $_SESSION['filepath'];
        

       $dot = strrpos($src, '.');
        if (!($dot === false))
        {
          $newsrc = substr($src, 0, $dot) . rand() . substr($src, $dot);
          if (rename($src, $newsrc))
          {
            $src = $newsrc;
          }
        }

        $filetype=$_SESSION['filetype'];
gitin’s picture

sorry not working for me, i still have to refresh crop page to c the actual uploaded image, otherwise it shows the old image which is already there or which is current pic of the user...
is anybody having the same problem..???

mmachina’s picture

I am getting the same problem... I checked the module code and it appears that the code suggested above has already been inserted into the module by the maintainer...

*****************************

$dot = strrpos($src, '.');
if (!($dot === false))
{
$newsrc = substr($src, 0, $dot) . rand() . substr($src, $dot);
if (rename($src, $newsrc))
{
$src = $newsrc;
}
}

*****************************

However, the problem still persists...

adeel.iqbal’s picture

@mmachina: can i see the problem? please show me your site? or send me your code so i can analyze the problem.

adeel.iqbal’s picture

Status: Active » Closed (fixed)

Resolved in later versions. Not reported again.