Linked Images, and resizing

Started by MothMan, December 16, 2006, 01:24:25 AM

Previous topic - Next topic

MothMan

Do I understand correctly that linked images which are posted are not checked for size?

I've got a 1.1 forum, and have tried setting max height and width in the Admin panel, but always, oversized images are posted with a horizontal scroll bar... which actually causes the whole post to scroll horizontally, not just the picture.

I've tried disabling the two max size attributes to see if there was any difference, and there is not... either way, oversized images appear exactly the same... oversized, with a horizontal scroll bar.

So... is the max height and width only relevant for attached images?

KGIII

I can't say that I have tried it but I've been under the impression that:

your_forum_URL/index.php?action=helpadmin;help=max_image_width

That is in Features and Options, down near the bottom. I imagine it makes use of the GD library though I suppose it could just force resizing via HTML.

Have you tried that setting? Either way, this is a case of an option I've not poked so hopefully someone will come along and give you a better or more authoritative answer.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

Yes, that is the max height and width settings that I was referring to.

For example, I currently have the max height and width both set to 600... but an oversized posted image looks like this:

http://othersi.ulmb.com/screenshot.jpg


pulkit

this is excatly for what i logged on today. to ask this question ...

and to help dial up users, is it somehow possible that all the pics be resized to thumbnails which open in a new window when the users click them ??

KGIII

Alright... Now I'm curious. :)

MothMan: When they attach an image, does it automatically generate a thumbnail? (Not when they link to it but when they attach it?) Better still, does a PHP info script show the GD library?

(I borrowed your image for this testing.)

I set it to 600x400 as the max.
http://dev.kgiii.info/forum/index.php?topic=6.msg14#msg14
In the source I see:

"http://kgiii.info/ignore/screenshot.jpg" alt="" width="533" height="400"


Which implies that it at least tried to keep the aspect ratio, the properites of the picture are the same and it is the same file size, it is just the dimensions that are different.

pulkit:

Only if they attach them as near as I know. You could install and encourage the use of this:

SMF Gallery:
http://mods.simplemachines.org/index.php?mod=473


My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

#5
KGIII,

If I enable attachment, and attach an image, the image resizes a thumbnail based on the size limits set in the Attachment and Avatars section of the Admin panel.

Eg:

In admin panel, Attachments and Avatars, I set max size to 500x500

In admin panel Features and Options, I set max size to 300x300

I posted this image:  http://othersi.ulmb.com/800x600image.jpg   which is 800x600.

When posted as an attached image, the image has a thumbnail created, which is resized to 500x375 (resized based on the 500x500 max in the Attachments and Avatars section, ratio is kept intact), with a link below to open the full-sized image.

When posted as a linked image (ie, using bbc img tags) the oversize image is posted full size (not resized according to the 300x300 limit set in the Features and Options section) with a horizontal scroll bar, which scrolls the entire post.

You can see my test posts here:

http://othersi.ulmb.com/forum/index.php?topic=54.new#new

You can log in as testuser (pass: testuser)

So, based on this... I COULD request all users to use the attach file method to post images... but that isn't going to work for us.  For one thing, we often post images found on other sites.. so having to do it as an attachment adds a step of the user having to download the image and then attach it.

PLUS, I don't have the biggest server space, and don't want it to fill up with all these image attachments.

What I would like is that LINKED images are resized based on the size limits I state.  I thought that's what the max width and height in the Features and Options section of the admin panel do, but those settings must be for something else, as they do nothing for linked images.

The linked image doesn't actually have to be downsized, and it's better if it isn't ... it just needs, basically, an automatic width/height tag added to it, so that it shrinks down the view of the image, based on my set maximums.

Does this make sense?

MothMan

Oh... also, you asked about phpinfo...

When I run that, the GD info is:

gd

GD Support              enabled
GD Version                bundled (2.0.28 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.2.1
T1Lib Support            enabled
GIF Read Support    enabled
GIF Create Support    enabled
JPG Support              enabled
PNG Support             enabled
WBMP Support          enabled
XPM Support            enabled
XBM Support           enabled

KGIII

You can probably see that I've been in there poking. I don't have an answer for you other than what I've said in your forum already.

http://dev.kgiii.info/forum/index.php?topic=6.new#new

From the top, the first images I posted. Resized... On my server.

One from your server - didn't resize.

One from my server (this time in gif format) resized.

One from another domain - resized.

Side note: It seems to resize it with the IMG code tag. If I hit modify it resizes it.

Anyhow, that's about all I've got for you.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

So, what you're saying is that in other SMF forums, linked images ARE resizing... but on my forum linked images are not?

KGIII

When I link to an image from your server it doesn't resize. When I upload the image to my own it resizes. I haven't a clue why honestly.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

#10
I appreciate all the time you're spending here, but I'm still a bit confused... so please bare with me. :p

So... what's happening is... an image stored on MY server does NOT resize when posted ANYWHERE as a linked image.

An image stored on a DIFFERENT server DOES resize when posted as a linked image.

BUT... ANY image posted on MY forum... whether the image is stored on my server or someone elses server, does NOT resize.

So... on my forum, images posted from ANYWHERE... whether it's my server, your server, some random server off the web... NONE of them resize as linked images.

It's like... there's a problem with BOTH my server (because pics stored on my server don't resize for ANYONE), and my forum (because pics stored ANYWHERE, when posted on my forum, don't resize)....

This is crazyness...  I need some serious help ... lol   No way I want to have to wipe everything and reinstall from scratch again.

KGIII

Quote from: MothMan on December 17, 2006, 12:52:29 PM
So... what's happening is... an image stored on MY server does NOT resize when posted ANYWHERE as a linked image.

An image stored on a DIFFERENT server DOES resize when posted as a linked image.

BUT... ANY image posted on MY forum... whether the image is stored on my server or someone elses server, does NOT resize.

You know... I don't know what all the repair_settings.php script that floats around in here does. It can't hurt... Well it could. Maybe? Else wait for someone more knowledgable than I.

But yeah, you have it right as near as I can tell.

Here's what we know...

An image on your server or posted to your server as an inline attachment does not resize in your forum.
An image from your server posted to my server doesn't resize - though it resizes just fine when posted to mine.

Have your hosts upgraded or changed anything?

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

OK, thanks for your time KGIII ... we haven't solved it, but at least I know the full extent of the problem. :p

I'll look into the repair_settings.php thing... and see what I can find out.

As for the host changing anything... I don't know... this is a new forum.  I've been playing with different software on this server for a month or two, but have only just gone "live".

But, from what I remember, right from when I started playing with the SMF software, linked images never HAVE resized for me... so I don't think it's anything new.

That said... the host is unlimitedmb.com, and there have been a couple weird issues I've come across... so I'm not sure.

Hopefully someone else sees this post and might have some insight.

Thanks again.

KGIII

Quote from: MothMan on December 17, 2006, 05:58:32 PM
Hopefully someone else sees this post and might have some insight.

Thanks again.

Not a problem. I see they're a free web hosting company. I clicked their about page and get a file not found error so it may well be something that they're having issues with. Often the servers of free hosts are swollen to full with data and traffic, full of bugs and cobbled together code, and end up causing the strangest errors. But, yes, hopefully someone else will come along with information that can help.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

Yeah... I'm not sure what state they are actually in... they state that they are in "beta" ... but it's said that for a long time... and much of the site has never been active.

KGIII

Mind a PM? (Nope, not a sales proposition or the likes.)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

MothMan

#16
PM is ok with me.


And, more info... apparently I've got bigger issues... lol

I tried repair_settings.php, but it tells me "Settings.php cannot be written to by your webserver. Please modify the permissions on this file to allow write access"... so that tool isn't going to work for me.  I've set the permissions (chmod) to full permission via ftp, but still no luck.

The more that I see, the more I think ulmb.com has issues.

MothMan

Just an FYI for anyone else following this thread... the issue, at least in my case, is with the host server... I've tested my forum on another server, and the iamge resize works as intended.

pulkit

so what do u guys suggest i do ?? u surrogate forum will not allow me to have my users attach images on their server space ... i want to have my users use free image hosting and post the pics to my forum using IMG tags ... that saves me disk space AND bandwidth so naturally i would want that ... the question still is that how can we achieve this without modifying the properties of the IMG tag in the php files to they read to the effect of "Resize all files larger that <somesize> to <user defined size>" ??

again, what if the image is resized but it looks all weird and the admin wants to turn this feature off ??

i guess there is no way around this because free imgae hosts would not resize the image on upload ... i have just posted an announcement on my forum saying that images larger than 640x480 need admin/mod approval and will be deleted without notice if still posted. currently i'm not deleting them, i'm resizing them to 640x480 (adding a watermark of course :) ) and uploading them too ... then it's either me or the mod or the user, who edits the post to confirm to the standard ... i usually just send the link to the new image to the user through PM

cheers ...
Pulkit

MothMan

I know it's not ideal, but you could post a rule for your users to resize the images themselves.

State your desired max image width... say it's 500px.  Tell your users that any image wider than 500px should have an adjusted posting format:

[url=http://www.yourweb.com/yourpic.jpg][img width=500]http://www.yourweb.com/yourpic.jpg[/img][/url]
Click to Enlarge


That code (obviously replacing the url in both the link and image part) posts the image downsized to a 500 width, with the height being the proper ratio, and users can click the downsized image to view the fullsized image in a new window.

Again, I realize this isn't ideal... it relies on the uers to do it, and to understand how to do it.  But I bet if you post the instructions, and remind your users to adhere to it, it won't take long for everyone to get on board.

pulkit

hey ... nice advise man ... this would work better than my technique ... mind if i steal your code and post in my my site ??

MothMan

Heh.  Go ahead, it's not "my code", just good ol' bbcode. :)

black.beard

#22
hey i was having the same problem. solved it by editing the post.template.php (just changed bbcode [img] to [img width=500] ).now i dont have to depend on users to add the width limit part, thanx to mothman :D

MothMan


Advertisement: