Forum Moderators: phranque
Currently I am contemplating to allow the user to choose the window width and height for javascript popups, which are rare on my site, but there are a few, the most important/ used one would be a image viewer.
I would also like it for the user to be able to chose the size of resized images so they will fit to that window neatly.
These variables will be stored in the DB and the values will be stored as session variables upon login, if nobody is logged, the session variables will already be initiated via a simple file include.
But I can see some downsides, one would be server performance.
I have a couple of functions which resize images and they basically all do this:
- check if original image exists
- if so, check if thumbnail was already created
- if so, check wether or not the size is the same as the arguments passed to the function, if so, echo to browser, else re-create thumbnail
- else make a thumbnail and store it in a subfolder, which is also created inside the function
- else echo error message
now if I would allow the user to specify the size he/ she wants her thumbnails in, they will be re-created a lot of time and the older file will constantly be overwritten. What happens if 2 user open the same file simultaniously? Will this work?
Any other comments are welcome!
Browsers in general are not great at this, but they're not bad and hey, they're only thumbnails.
your other suggestion could work, but it would could me a lot of disc space
some movies have 100 images, so if I finally have the 10000's movies I intend to have in the DB, this would require massive file storage.
But by then, I might be able to afford it, who knows :p