TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 340
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 355
  • Total: 355

Auto resize images on portal?

Started by Swifty550, March 14, 2012, 06:07:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bloc

Quote from: ZarPrime on March 15, 2012, 08:25:29 PM
This is the exact reason why I don't think it's that great of an idea.  It probably wouldn't be too bad for one page of 15 images on the FrontPage but, as more and more topics are added that are promoted to the FP, the number of images that will have to be resized will multiply geometrically.  After a while, loading the FP would slow to a crawl as more and more images would have to be resized before the browser even gets them.  Combine that with doubling up on the number of images and the space to store the double images will get used up faster and faster.  Of course, a function could theoretically be written to unload the smaller images when they are no longer needed for the FrontPage and then delete them from the server, but that could conceivably cause massive lags to occur on the site as it increases in size.

ZarPrime

Well..I think you are making it way more complex than it is..for one: adding thumbnails is done preferably at promotion time, so the images are already made when someone hits the frontpage. And two: smaller sizes won't make much splash on the server space..if we are talking tens of thousands of topics per day, well, ok, you might get that, but then space isn't your main concern anyway. ;)

Removing temporary images is a bad idea..that will surely make the server crawl if it have to undo its cached images and redo them again. Maybe a time limit could be used, but the same can be said about attachments really.They too are made as thumbnails and the closer thumbs are to originals of course less effective is the thumbnail. There is no need to scale a max 600x600 to 400x400, you typically rather upload a max 1200x900 and THEN do a thumb of 200x200 for the frontpage. the difference in size will be considerate. You lose some server space, but gain responsive pages and happy visitors.

I once set originals to be displayed in full on Mammakroken, and guess what happened..people posted 20-30 pictures in 800x800 in a single topic, the page was awfully slow(this was pre-Nginx tbh) ..but putting the attachments thumbs to 150x150 solved that.  Same principle applies to topics-on-frontpage really, browser resizing is nice and saves your server space some..but you get slower pages.

Swifty550

All images are hosted on remote servers. Least you guys know what I'm on about now.  ;)

Would be great if you could consider adding this option. Only thing stopping me using TP right now. :(

G6Cad

I dont think any new features will be added in to TP, we aim for Final now and after that i think the dev will stop, atleast for a while.

IchBin

Quote from: G6Cad on March 16, 2012, 07:35:47 AM
I dont think any new features will be added in to TP, we aim for Final now and after that i think the dev will stop, atleast for a while.

That's the plan. There's no reason someone couldn't figure out how to put this work around in for the guy if they want though.

ZarPrime

Quote from: bloc on March 15, 2012, 10:44:19 PM
Well..I think you are making it way more complex than it is..for one: adding thumbnails is done preferably at promotion time, so the images are already made when someone hits the frontpage. And two: smaller sizes won't make much splash on the server space..if we are talking tens of thousands of topics per day, well, ok, you might get that, but then space isn't your main concern anyway. ;)

Removing temporary images is a bad idea..that will surely make the server crawl if it have to undo its cached images and redo them again. Maybe a time limit could be used, but the same can be said about attachments really.They too are made as thumbnails and the closer thumbs are to originals of course less effective is the thumbnail. There is no need to scale a max 600x600 to 400x400, you typically rather upload a max 1200x900 and THEN do a thumb of 200x200 for the frontpage. the difference in size will be considerate. You lose some server space, but gain responsive pages and happy visitors.

Bloc, of course you're right.  That's why you are the expert. ;) I had forgotten about the cache so removing the smaller images would definitely be a bad idea.  There may be an easy way to resize topic images for display on the FrontPage.  I'll take a look at some code on this in the next couple of days and see what I can find out.  Maybe if Freddy sees this, he'll have some thoughts on it as well.

ZarPrime

IchBin

I started a script at one time, I think it may be on Lurks test site. Which grabbed specified topics. If the topic had a BBC image posted in it, it would create a thumbnail and display it on the frontpage along with the post. I can't remember how far I got on that. But it was something that could probably be looked into if someone had the time.

ZarPrime

Thanks Ichbin.  I'm an Admin over there as well so I'll see if I can find it and take a look at it, maybe over the weekend.

ZP

lurkalot

Jim, Brad's block is still on my site.  It's a upper block number 30 Titled "Brads Test Bock"  ;)

Trouble with creating and leaving a temporary image on the server is you're doubling every image, and they count towards inode usage, hence why I asked Brad to try and make the script delete the image when finished with it.  (That said, even deleting the image doesn't actually reduce the inode usage I believe, unless the host reboots the server.)   

Most hosts are very strict on inode usage, (especially shared servers) and when you reach a certain number will stop automatically backing up your site, reach the next threshold, and you'll be violating their terms and conditions, and probably get shut down. 

One file / folder = one inode.  It doesn't take long to reach the inode limit of 100,000 inodes for example.

That's why I'd prefer them resized on the fly, in browser.   ;)

Swifty550

If someone could have a look into it please, that would be greatly appreciated. All it needs to do is resize the image to maybe 300x300 or along those lines when ever it's posted to the front page.

I know it may be asking a lot, but it would be greatly used.

Thanks for all your time.

This website is proudly hosted on Crocweb Cloud Website Hosting.