Open GoogleCodeExporter opened 9 years ago
It would be good to have image assets for each avatar, so a cron solution
sounds good.
Original comment by FireCent...@gmail.com
on 26 Nov 2010 at 1:00
Agree it should be a background task that doesn't block viewing the page, but
HTML already makes loading images a background task that doesn't block viewing
the page, so maybe with should run with that?
I'm thinking we make the image loading happen when the browser requests it.
That way if you've just made a change and registered an avatar, you'll get your
image straight away without needing to wait for the cron.
So we'd have something like:
fetch_image.php?avatar=whoever (Script to serve an image)
1. Checks if it has a recent copy of the image on the filesystem - if it does,
serves that. (We might have to configure how recent.)
2. If there's no recent image, fetch it from wherever it has to come from, save
it to the filesystem and serve it.
3. If it couldn't find one, save a placeholder image to the filesystem instead.
Then on the view page, have a profile picture display div where:
1. The div background displays the image on the filesystem if there is one, or
the original placeholder image if there isn't one. (That way if you're waiting
for an image to load from an external grid, you'll see the background image,
which was already on the filesystem so it loaded first.)
2. The foreground image loads from fetch_image.php, which can take its own
sweet time.
Original comment by edmund.e...@gmail.com
on 26 Nov 2010 at 3:11
Sounds like a great idea.
At the moment it's not actually caching the image files locally -- it's just
caching the URL of the image on the SL system and giving that straight to the
user. In theory though, it should be no problem to store avatar images
alongside other user data in the moodledata folder.
Incidentally, the "view/user.php" and "view/users.php" scripts both need a big
overhaul, as the code structure is pretty horrendous. (I don't think I've
really done anything serious to them since about v0.21!) This could be made
part of that process.
Original comment by peter.r.bloomfield
on 26 Nov 2010 at 3:32
Original issue reported on code.google.com by
peter.r.bloomfield
on 26 Nov 2010 at 12:48