Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: Cheese Head - tammikuu 30, 2009, 09:54:47 AP

Otsikko: Posts with Images From Other Websites
Kirjoitti: Cheese Head - tammikuu 30, 2009, 09:54:47 AP
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 (http://cheeseforum.org/forum/index.php/topic,777.msg5757.html#msg5757).

Any advice appreciated.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: karlbenson - helmikuu 05, 2009, 09:04:19 AP
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.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Cheese Head - helmikuu 13, 2009, 07:25:37 IP
regularexpression, thanks.

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

I assume those are the two you mean?

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

Thanks anyway.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: greyknight17 - maaliskuu 01, 2009, 06:27:35 IP
Cheese Head, is this issue resolved now? If not, have you tried using the Highslide Image Viewer mod (http://custom.simplemachines.org/mods/index.php?mod=1450) as mentioned earlier? It should do what you need there.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Rumbaar - maaliskuu 01, 2009, 07:16:49 IP
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.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Cheese Head - maaliskuu 08, 2009, 12:35:22 IP
Thanks both.

Looked at Highslide Viewer (http://custom.simplemachines.org/mods/index.php?mod=1450) 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 (http://cheeseforum.org/forum/index.php/topic,1034.0.html). Not sure if this is related or I should start a new Topic.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Rumbaar - maaliskuu 08, 2009, 08:09:09 IP
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.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Cheese Head - maaliskuu 08, 2009, 10:56:29 IP
Ruumbaar thanks for checking but huh?

In this link (http://cheeseforum.org/forum/index.php/topic,777.msg5757.html#msg5757), 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 (http://cheeseforum.org/forum/index.php/topic,1034.0.html) 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.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Rumbaar - maaliskuu 09, 2009, 03:03:06 AP
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.
Otsikko: Re: Posts with Images From Other Websites
Kirjoitti: Cheese Head - maaliskuu 20, 2009, 09:07:58 IP
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.