Link to my site: http://localhost
SMF version: SMF ver. 2.0.2
TP version: TP ver. Latest
Default Forum Language: English
Theme name and version: Default Cruve
Browser Name and Version: Firefox Latest
Mods installed: Highslide
Related Error messages: N/A
Is there a way to automatically resize images when I promote a post from the forum - bit like PortaMX/SimplePortal?
I'm not aware of any portal re-sizing images like that. It would required quite a bit of resources and code to do such a thing. Not something I really want to worry about at this time.
Simple Portal lets you - Enables resizing images in articles and board news to 300x300px, to prevent possible overflows.
Does it actually re-size the image? Or does it just add a width/height to the image tag?
Quote from: IchBinâ,,¢ on March 14, 2012, 09:50:09 PM
Does it actually re-size the image? Or does it just add a width/height to the image tag?
Sorry, I confused it. It just adds the width/height to the image tag.
Swifty550,
Are you aware that there is a setting in your Admin area to set the maximum vertical and horizontal size of images in posts? Those settings are located in Admin --> Features and Options --> Layout --> Max width of posted pictures (0 = disable) & Admin --> Features and Options --> Layout --> Max height of posted pictures (0 = disable)
I just tested this with settings of 600 pixels and 300 pixels. If you are using the TinyPortal option for "Selected topics + articles" (Promote to FrontPage) for "What to display on frontpage:", the sizes can be set by you as the Admin of your site but you can't adjust these sizes dynamically. They have to be set and then any future images posted to a topic that is promoted to the FrontPage, will use those maximum sizes (see test image below).
Is this what you are trying to do?
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi714.photobucket.com%2Falbums%2Fww142%2FZarPrime%2FTest-FP-Promote-Posts.png&hash=69d7e5b716f1168f33f2ca494c83972fc2e977b0)
ZarPrime
Quote from: ZarPrime on March 14, 2012, 10:12:40 PM
Swifty550,
Are you aware that there is a setting in your Admin area to set the maximum vertical and horizontal size of images in posts? Those settings are located in Admin --> Features and Options --> Layout --> Max width of posted pictures (0 = disable) & Admin --> Features and Options --> Layout --> Max height of posted pictures (0 = disable)
I just tested this with settings of 600 pixels and 300 pixels. If you are using the TinyPortal option for "Selected topics + articles" (Promote to FrontPage) for "What to display on frontpage:", the sizes can be set by you as the Admin of your site but you can't adjust these sizes dynamically. They have to be set and then any future images posted to a topic that is promoted to the FrontPage, will use those maximum sizes (see test image below).
Is this what you are trying to do?
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi714.photobucket.com%2Falbums%2Fww142%2FZarPrime%2FTest-FP-Promote-Posts.png&hash=69d7e5b716f1168f33f2ca494c83972fc2e977b0)
ZarPrime
Hi ZarPrime, thanks for your response.
I'm afraid that isn't what I'm trying to do. Let me try and explain clearer...
Currently I have Highslide installed and set the maximum width to be 600px via Admin --> Features and Options --> Layout. This works perfect as it should.
Now; as you've shown - TP will use that setting on the front page. 600px on the front page and on the forum post.
With Simple Portal, regardless of the max width I set in the layout option - any image on the front page will be re-scaled via width/height of 300px. So now the front page images are 300px wide but the forum post has the standard 600px wide.
Can this be done with TP considering I prefer this portal due to the articles/features it provides.
Added an image to show you what I mean.
Top of the image is the post, bottom is the front page.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi1261.photobucket.com%2Falbums%2Fii584%2FUnleashed55%2Ffrontpage.png&hash=7762bea48e259fcdaf819f62e6ac25150f36c4fb)
Well, I have to admit that I'm not really well versed with all the options in SimplePortal, and especially with PortaMX. So, are you saying that there is a setting in SimplePortal that will allow you to set images on the SimplePortal FrontPage to be a different size than the setting that is used in a post in the Forum? If that's the case, I really don't know of a way to do this, other than setting the sizes to be the same on both as I explained above. Maybe one of the other Team Members here knows a little more about how to do something like that but I expect that it's as Ichbin mentioned, the sizes are controlled by SMF.
ZarPrime
From looking, they use a portal.js file with this code?
function sp_image_resize()
{
var possible_images = document.getElementsByTagName("img");
for (var i = 0; i < possible_images.length; i++)
{
if (possible_images[i].className != (portal_smf_version == 1.1 ? "sp_article" : "bbc_img sp_article"))
continue;
var temp_image = new Image();
temp_image.src = possible_images[i].src;
if (temp_image.width > 300)
{
possible_images[i].height = (300 * temp_image.height) / temp_image.width;
possible_images[i].width = 300;
}
else
{
possible_images[i].width = temp_image.width;
possible_images[i].height = temp_image.height;
}
}
if (typeof(window_oldSPImageOnload) != "undefined" && window_oldSPImageOnload)
{
window_oldSPImageOnload();
window_oldSPImageOnload = null;
}
}
It seems when on the front page it adds a temporary size of 300x300. Would be good if you guys could take a loot please. :)
Quote from: ZarPrime on March 14, 2012, 11:22:52 PM
Maybe one of the other Team Members here knows a little more about how to do something like that but I expect that it's as Ichbin mentioned, the sizes are controlled by SMF.
Zar & Swifty550, you won't be surprised to hear, that I don't have a clue either. :D But in all honesty it's a great idea.
One of the reasons I hardly ever use the promote to front page option for topics. As my site is based around photography, a lot of the posts have large photos in them. I doubt IchBin will add this as a feature now we're so near to going final. But I'd also be very interested in a workaround for this problem. Might also make a great feature for TIchyPortal MK2.
True.
The downloads part of TP does have some resizing routines..I used them to make thumbnails of uploaded images. But SMF has also its own routines for that, which is used for attachments and their thumbnails, TP or other scripts *could* use them in combination with a setting - so they don't resize on every page-load.
Using CSS or javascript is of course easier..but not optimal, as you still downloads the "bigger" image, just resizing in browser.
Quote from: bloc on March 15, 2012, 08:23:17 AM
Using CSS or javascript is of course easier..but not optimal, as you still downloads the "bigger" image, just resizing in browser.
I guess going this route is not an easy job?
Would be nice to have the feature in TP. :(
Quote from: bloc on March 15, 2012, 08:23:17 AM
Using CSS or javascript is of course easier..but not optimal, as you still downloads the "bigger" image, just resizing in browser.
Resizing in browser would be fine I guess, as long as there's not too many really big images. Freddy built me a poll block Here (http://www.tinyportal.net/index.php?topic=32981.msg264890#msg264890) which I use on my front page, it resizes on the fly. I use it for my members weekly competition poll. http://cameracraniums.com second block down in the middle. ;)
Yes, its not that bad if you keep the 2 sizes not too far apart ans its only a block with a few images.. But it can make a difference if you have 15 browser-resized originals on the frontpage. You will notice that.
Thats why actually making a smaller size in the first place will be better, page loads faster and you save some bandwidth(I know, broadband is common these days, but if everyone just makes big sizes on..whatever, even broadband will be slow).
Whether its to be added to TP is up to the team of course, and prob. not before a future version beyond v1.0.
Also big size images will eat your server BW rater quickley if you have a big forum with a lot of visitors.
I always run my photos in PS and save them for web before i upload them, often as 1024/768 format
When you save them for web in PS they will still have the great sharpnes to them, but very reduced in size.
If you take this images as an example, from start it is 6mb in size and format 2300x1800
Here it's been resized to 1000x600(something) and it's 107kb in size and still keep the sharpness to it.
Just some consideration, about images.. like mention above they do take up space and load down the server, unless you use like another sites storage space for them.
If you want to run photos on you site they should be done using some sort of limitations. in size disk space and using server compression tools such as GDZ or ImageMadgick and other such tools, this along with a directory / folder they will be filed in Like done with some gallery mods.
It not 0only the server that get loaded down but most host on allow a certain amount of DB space, and bandwidth.
So there are more one consideration here. Somethings are very neat and look very nice but, if and when your site goes, to over 100 users at a time , you may find you site stuck in the twilight zone! due to overload!.. Even with a gallery and compression tools this will slow down and or stall your site, unless your paying big bucks!
Just a thought or two!
regards,
maxx
Quote from: G6Cad on March 15, 2012, 11:52:42 AM
I always run my photos in PS and save them for web before i upload them, often as 1024/768 format
When you save them for web in PS they will still have the great sharpnes to them, but very reduced in size.
You mean you resize them using the "save for web" option? That's fine, but normally it strips out the EXIF info when using that method. That's fine for a personal gallery, or web graphics etc, but not for a photographic community situation, as that info is valuable. ;).
Quote from: Swifty550 on March 14, 2012, 11:27:20 PM
From looking, they use a portal.js file with this code?
It seems when on the front page it adds a temporary size of 300x300. Would be good if you guys could take a loot please. :)
I've looked at the code and I see what they are doing. Of course, there is more to this than just the javascript, in other files of course, though it seems that it can't really be adjusted to a size of the user's choice but is static at 300px by 300px. However, there is still the consideration of what kind of a load doing something like this would add to the site's server and the user's local computer, especially for a large site.
Quote from: bloc on March 15, 2012, 10:46:03 AM
Yes, its not that bad if you keep the 2 sizes not too far apart ans its only a block with a few images.. But it can make a difference if you have 15 browser-resized originals on the frontpage. You will notice that.
Thats why actually making a smaller size in the first place will be better, page loads faster and you save some bandwidth(I know, broadband is common these days, but if everyone just makes big sizes on..whatever, even broadband will be slow).
Whether its to be added to TP is up to the team of course, and prob. not before a future version beyond v1.0.
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.
Quote from: lurkalot on March 15, 2012, 06:00:18 PM
You mean you resize them using the "save for web" option? That's fine, but normally it strips out the EXIF info when using that method. That's fine for a personal gallery, or web graphics etc, but not for a photographic community situation, as that info is valuable. ;).
Lurkalot makes a good point about photos, that's for sure. My thinking on this goes back to my suggestion from earlier, especially if a user has something like Highslide installed. Let SMF resize the images one time at the very beginning (300px X 300px), make your users aware that any image can be enlarged with Highslide just by clicking the image, and let it ride. Setting the maximum width and height of the images in both topics and on the FP would be much easier on the server and, in most cases, it would make no difference to your members.
ZarPrime
Believe it or not, on one of the other photography forums I've been moderating for about five years, it's a Future Publishing site, called Photo Radar (formally Digital Camera Magazine)
We actually had someone complain that he couldn't upload a 66MB Raw Neff file to the galleries. lol.. :uglystupid2:
Really Sorry Swifty550, I seem to have hijacked your thread. :-[ That said, it, it doesn't hurt to discuss these things, some good might come of it. ;)
Quote from: lurkalot on March 15, 2012, 08:54:46 PM
We actually had someone complain that he couldn't upload a 66MB Raw Neff file to the galleries. lol.. :uglystupid2:
<Oh My Gosh> That's crazy :idiot2: and somewhat silly as well. ::)
ZarPrime
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.
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. :(
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.
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.
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
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.
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
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. ;)
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.