From d097b4fc027ff558bf5f580298c7bed3696dcd3d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 26 Feb 2009 23:38:17 +0000 Subject: Update to image_block based on bharat's feedback 1) move the rand_key column into core 2) don't do a max rand, just try to a get a random number less than the current random number if that doesn't successd look the other way --- core/helpers/photo.php | 1 + 1 file changed, 1 insertion(+) (limited to 'core/helpers/photo.php') diff --git a/core/helpers/photo.php b/core/helpers/photo.php index 423c1973..c98af2f9 100644 --- a/core/helpers/photo.php +++ b/core/helpers/photo.php @@ -63,6 +63,7 @@ class photo_Core { $photo->mime_type = empty($image_info['mime']) ? "application/unknown" : $image_info['mime']; $photo->thumb_dirty = 1; $photo->resize_dirty = 1; + $photo->rand_key = ((float)mt_rand()) / (float)mt_getrandmax(); // Randomize the name if there's a conflict while (ORM::Factory("item") -- cgit v1.2.3