Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Posts with Images From Other Websites

Aloittaja Cheese Head, tammikuu 30, 2009, 09:54:47 AP

« edellinen - seuraava »

Cheese Head

For members uploading/attaching images to posts, I've limited post image size to 640x480 pixels for users with slower internet connection, but users can click on image to get full size picture if they so want.

My problem is how to control displayed image size on linked pictures like this post.

Any advice appreciated.

karlbenson

Admin > Features & Options.

Max height of posted images
Max width of posted images

There are also mods in mod site like HighSlide viewer which can change how posted images are shown in topics.
And there are other ones which can resize it smaller with warning and such.

Cheese Head

regularexpression, thanks.

Under Admin > Configuration > Options page, at bottom there is two settings:

  • Max width of posted pictures (0 = disable) which I have set to 640
  • Max height of posted pictures (0 = disable) which I have set to 480

I assume those are the two you mean?

I tried changing that, didn't change the Members linked picture size . . .

Thanks anyway.

greyknight17

Cheese Head, is this issue resolved now? If not, have you tried using the Highslide Image Viewer mod as mentioned earlier? It should do what you need there.

Rumbaar

I'm sure it takes affect only on images that are posted after the settings are define.  So it's not re-actively assigned to past posts.  You can edit it manually and assign the size limits to the img tags.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Cheese Head

#5
Thanks both.

Looked at Highslide Viewer but not OK'd for my SMF version 2.0 RC1.

Ruumbaar, I have those two settings to 640 x 500 max and added a new post with that same link and got same off the screen huge image problem.

Also, I have problem of images not sizing or aligning properly in Browsers Mozilla and iPod Touch, members screenshots of problem here. Not sure if this is related or I should start a new Topic.

Rumbaar

I don't see any images posted in those threads.  Those settings only affect images posted via the [img][/img] tags.  Attachment thumbnail and sizes for attached images is handled in the Attachments and Avatars section.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Cheese Head

Ruumbaar thanks for checking but huh?

In this link, the picture the member attached is huge and so big that it has scroll bars, at least in my IE7. That's my original problem of this Topic.

In this link of the second possibly associated problem, first picture in Topic shows screenshot of my forum in Mozilla where the first image is incorrectly displayed to right and over top text, second screenshot in Topic is mine of same post in IE7 showing that it appears correctly. Third & fourth images in Topic is another member's screenshots in Chrome showing it's also not displaying images correctly as they appear off right side of screen.

Sorry no screen shot of iPod Touch but a member says it also displays images incorrectly.

I'm not sure if these two problems are connected. On first problem of images too big, I've changed size in Attachments, but I can still make a new post with a new link to that external image and it still displays huge with scroll bars.

Thanks again for your support.

Rumbaar

The problem I can see with that particular images is that forum tries to get the size of the image from the hosting server, if it fails it's unable to get them and thus apply any size restrictions.

If you try it on a locally hosted site or a 'normal' site it should resize correctly.

In the $source/Subs.php file there is a function called:
function url_image_size($url)
Which is used to get those sizes, but can return $false if it's unable too.

Which in turn if it's can't find it, the    code in Subs-Post.php
// Limit the size of images posted?
if (!empty($modSettings['max_image_width']) || !empty($modSettings['max_image_height']))

When it calls that function can't define the correct defined size.

Not sure how to fix this in an automated way.  If a host is blocking such server access it might be impossible.  Though you can manually go in and assign the width/height attributes to the IMG tags.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Cheese Head

Rumbaar, sorry for the delay, I've been on family holiday for the last 9 days. 

Thanks for response, that is probably it as an isolated instance that I think has only happened twice, probably a member posting from same host. I'll manually edit img tag sizes when I figure out how to do that.

On my other problem of forum not appearing correctly in other browsers, I'll start a new Topic.

Case closed, thanks again.

Advertisement: