News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How can I pre set pasted image widths and heights ?

Started by XHIBIT911, May 27, 2013, 01:25:40 PM

Previous topic - Next topic

XHIBIT911

Sometimes when people post tips and how to tutes the entire article along with images is posted in 1 big copy and paste job.
How can I pre set it so that the images are auto resized to fit the parameters of the forum so it doesnt wind up being all stretched outside of the borders ?

TheListener

I would either ask the folks to use www.picresize.com

The way I get round this is by making it a rule that ALL images are to be added to my forums gallery first then embedded into a post.

Not everyone wants to do this though.

:)

Arantor

Admin > Configuration > Features and Options > Layout > Max width of posted pictures / Max height of posted pictures

Note that the size will only be checked on saving of the post, if the image cannot be found at the time for whatever reason, SMF will not force the size to be any different, nor will it go back and apply the setting to older posts.

TheListener


XHIBIT911

So if its a copy and paste job and I have the Max width and height configured its 50/50 that SMF will read it correctly and not scale it ?
Also I actually dont want every image uploaded unto my already cramped server ...I have multiple websites and  copy and pasted images is my friend

Arantor

If you set a max width and height, and post a smaller image than the max height, SMF won't scale it (because it's smaller than the max size)

Note that this is NOTHING to do with uploaded images. This is to do with images posted in posts with the img bbcode...

XHIBIT911

Ok I gotcha...as long as the images are posted using the bbc tags then it will auto size if its too large.
Its not quite what I was hoping I could pull off but thats fine

YogiBear

What you need to watch for is if someone pastes a direct URL (hotlinks) an overlarge pic from another site as this won't be automatically resized. I too have suffered the gigapixel brigade.
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Arantor

Quote from: XHIBIT911 on May 27, 2013, 02:11:16 PM
Ok I gotcha...as long as the images are posted using the bbc tags then it will auto size if its too large.
Its not quite what I was hoping I could pull off but thats fine

So why not tell us what you were actually hoping for? I answered the question you asked. If they're copy/pasting entire pages (which means WYSIWYG editor), it's done through bbcode anyway. So this already applies.

XHIBIT911

Well I did actually say what I was hoping for.
I'd prefer external linked images since server space is precious.
And if the images are copy and pasted (which you wound up answering) there's no real way to pre size it. Yogi was spot on with the problem that it presents if the image is too large from the post pasting.

A few years ago I was on a radio station site that encouraged pasting of current events and somehow whatever people posted (the images regardless of size) always fit within the parameters of the post itself. So I know its possible. I guess SMF just hasnt tackled it yet.

YogiBear

Do you remember what make of software that radio station site was using ? It could just give us a clue as to how they did resize those pics.
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Arantor

QuoteSo I know its possible. I guess SMF just hasnt tackled it yet.

No, I guess you just didn't read what I said.

If they copy and paste the images, they're NOT ON THE SERVER.

BUT, you can STILL LIMIT the size of the image from flowing out of the post WITH THE OPTION I SAID.

XHIBIT911

Yogi its been a couple of years and you know how media sites are always scrambling to outdo each other by constantly upgrading to the newest formats possible and everything is completly different and I suspect even under new management now so I honestly couldnt say.

And Arantor, bro I did try your method, and the issue is if I copy an article from another site that has images in it and paste the entire article in my smf forum, it will post the images' actual size, this is regardless to the size that the image was even on the other site that it was copied from. They may have scaled it down ...just to fit properly on their site, but if I copy and paste it to smf once its pasted the size will show as original.

What you suggested was to insert each image using bbc code...I'm talking about copying and pasting the entire article as is.

Arantor

-sigh-

QuoteWhat you suggested was to insert each image using bbc code...I'm talking about copying and pasting the entire article as is.

Yes, you use the WYSIWYG editor. Which goes through a fun function called html_to_bbc to convert the post back to bbcode.

That says to me either 1) you set the maximums too high or 2) there's a problem with your server going to check the size, or possibly 3) a bug in SMF itself.

But since you haven't given me any details to work with (like examples or anything) or indeed what you've actually configured it to, I can't help you.

XHIBIT911

Man....when people that use forums, just regular users not mods or admins or anything.....(just the common Joe and Jane) copy and paste into forums...they arent using WYSIWYG editor. They're simply copying and pasting. My max is at 500 w X 400 h.... so I'm fine width and height wise. The server is functioning quite well and the point Im trying to make is a simple copy and paste...no editors...no bbcodes...no nada, Just copy and pasted content.

I know it can be regulated because I've seen it on another site...but this is just a small flaw thats never been addressed in SMF. The images WILL spill outside of the post parameters if its a simple copy and paste. I'm not talking about using any editors or codes. Just copy and paste.  In fact..if I recall correctly I had a stargate portal system that copy and pasted content DIDNT spill out of. Nor did I have to use any editors or codes

Arantor

In which case if they're not using the WYSIWYG editor, the images won't even be linked in the first place.

I doubt most people even know which editor they are using. Do you know which you are using?

QuoteI know it can be regulated because I've seen it on another site...but this is just a small flaw thats never been addressed in SMF

So, just because it isn't working for you under a specific situation that you won't give me any details about, it MUST somehow be SMF's fault? I'm still betting that you haven't got it set up right, or you're doing something else but you won't give me any examples to actually look at to try and reproduce this, or god help me, get it fixed.

XHIBIT911

Ok youre puttin waaaaaaaaaaaaaaay too much into this. Youre adding words that I didnt even say other than its a small flaw thats never been addressed by SMF.
Hell I just tried as a test to do a simple copy and paste of an article that had images in it. Just like people do all the time in forums.
Everyone (at least the common forum poster ) isnt using editors and even fewer use the BBC code itself.
Ive given you specific details and you keep saying that Im not.
How much more specific can I be ?


Go to a site...find an article with images and copy the entire article...images and all in 1 copy and paste it in this forum and you'll see for yourself.

Dont use any editor, dont use any BBC code, just copy and paste it.
Its the simplest form of copy and pasting that people do. Yogi even named em the gigapixel brigade.
Contrary to what you may believe everyone does not use the editor or the codes. They just post or post copied content by pasting it.


Heres an example:
This is a copy and paste with no editors or codes (the pictures just happen to fit because they were already  scaled on the other site)
http://hobbymafia.com/forum/general-discussion/test-2/

Now heres another copy and paste:
And you'll notice the size of the images stretch the page out and make the portal block off center
http://hobbymafia.com/forum/general-discussion/test-3/

Arantor

QuoteIve given you specific details and you keep saying that Im not.
How much more specific can I be ?

How about some examples? Examples of what you copied, where you copied it to, that kind of thing.

QuoteDont use any editor, dont use any BBC code, just copy and paste it.

WYSIWYG is on by default IIRC.

If it's not, the images just won't appear. Unless you have some fun and interesting mods you're not telling me about.

QuoteContrary to what you may believe everyone does not use the editor or the codes. They just post or post copied content by pasting it.

Who's putting words into whose mouth now?


EDIT: Show me in the test board here. I bet it doesn't work the same way here.

XHIBIT911

The post above has links as examples.
Sometimes the images might be scaled on the website they were copied from...but when you post them as a copy and paste into SMF forums, the ORIGINAL size is how they wind up showing in the post is my entire point.
Its not that big a thing to me to keep going back and forth over it, so no worries, sorry if you still don't understand me. I've said it as clearly as possible bro

Arantor

QuoteHeres an example:
This is a copy and paste with no editors or codes (the pictures just happen to fit because they were already  scaled on the other site)
http://hobbymafia.com/forum/general-discussion/test-2/

And if I examine the source, for that image I find:

<img src="http://www.modelcars.com/scale.gif" alt="Model Scale height=580" width="450" class="bbc_img resized" style="cursor: pointer;">

The bbc_img was added when the img bbcode was parsed out and turned into something else, and the width was set to 450 by the resizing process as evidenced by the 'resized' class. The fact the alt tag is broken is because the html to bbc parser is broken.

QuoteNow heres another copy and paste:
And you'll notice the size of the images stretch the page out and make the portal block off center
http://hobbymafia.com/forum/general-discussion/test-3/

First image has a width defined of 600, again showing the resized code, which suggests that at some point when it was posted you had a max of 600 set.

In fact, all the other images in that thread do the exact same thing. Which tells me that what I've been saying is exactly the case: you're using WYSIWYG, don't realise you're doing it, posting raw HTML and it's being converted to bbcode for you.


EDIT: Go into those threads and press edit. If the little arrow icon on the far right is lit up, you're in WYSIWYG mode. Press it and you'll see the bbcode that got made out of what you posted.

Advertisement: