]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Corrected thumbnail creation.
authorSebastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 20:24:41 +0000 (21:24 +0100)
committerSebastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 20:24:41 +0000 (21:24 +0100)
Because some systems do not allow file overwriting when doing a
rename().

index.php

index 1ac5187b91d54391961b27d877f85f088ed44390..4068272c0b84f36f940dde37d95aad217aca1934 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2336,6 +2336,7 @@ function resizeImage($filepath)
     imagejpeg($im2, $tempname, 90);
     imagedestroy($im);
     imagedestroy($im2);
+    unlink($filepath);
     rename($tempname,$filepath);  // Overwrite original picture with thumbnail.
     return true;
 }