Search code examples
phpfilesize

filesize not update after change file


PHP code

echo filesize("a.jpg")."<br/>";

imagejpeg(imagecreatefromjpeg("a.jpg"), "a.jpg", 50);

echo filesize("a.jpg");

Output

73104
73104

I have change quality of image but filesize not changed!!!

However, the file size changed?! enter image description here

why function filesize not updated immediate after change file?

My image(size 72k) enter image description here


Solution

  • As the manual puts it:

    Note: The results of this function are cached. See clearstatcache() for more details.