News:

Wondering if this will always be free?  See why free is better.

Main Menu

resize too large images

Started by Seph|roth, September 14, 2003, 11:42:58 AM

Previous topic - Next topic

Seph|roth

for the sake of readability...

i would like to see that images that are too large are automatically resized to fit. When a user clicks on the pic, the full-sized one is opened in a new window.

Like on this forum: http://forum.fok.nl
An example: http://forum.fok.nl/showtopic.php/385635

bostasp

Seems a good idea... for a few minutes I thought you meant avatar images, since my knowledge of dutch is non-existant.

I like it, save a massive scroll horizontally to see a full image.

Shoeb Omar

Umm... not sure if you can do this with PHP, but you would need to find out whether the image is under the size proportions and if it is, don't resize it, but if it isn't resize it.  Get my drift?

Anyway, I think you'd probably need somethign like Imagemagick installed for this, but as I sad I don't know :).

Seph|roth

imagemagick... or GD, which is pretty common nowadays... most hosts have it installed.

Shoeb Omar

GD can be used for image manipulation?  I always though ti was for image creation heh.

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Seph|roth

Quote from: Shoeb Omar on September 14, 2003, 12:09:07 PM
GD can be used for image manipulation?  I always though ti was for image creation heh.
can be used for both

Quote from: Owdy on September 14, 2003, 12:09:41 PM
Nice images Seph|roth  :P  ;D
thought you might like 'em ;)

Seph|roth

#7
I don't even think they use GD or something similar for this... i think they have a PHP script that checkes the posted img's width+height, let's say 300x600.. max allowed width is let's say 200 => the script calculates the appropriate height (in this case that will be 300 400 ;)) => and the script writes those values to the <img> tag. causing the browser to auto resize the img. Tha't why the img's will look a bit cluttered afterwards.. but you don't need any lib's for it this way.

Anyway, just a guess how i could be done maybe :P

Shoeb Omar

Yes, but if the image size is smaller than the limit it will stretch it.. unles syou use javascirpt, or php to detect if it;s under the size

Seph|roth

Quote from: Shoeb Omar on September 14, 2003, 05:30:19 PM
Yes, but if the image size is smaller than the limit it will stretch it.. unles syou use javascirpt, or php to detect if it;s under the size
well, if it can detect the size (which it can ;)), you can ofcourse make it so that when it is smaller than max-width, it doesn't do anything...

Anyhow, i think this is how they do it a the forum i listed above...

Brian Lacy

Good idea. I run a forum for the development of an adventure game, and whenever people post background or concept images, it throws the whole forum out of whack for people with smaller screen resolutions (i.e. 800x600). I'd very much like to have larger images automatically resized to a maximum value -- perhaps a value that could be specified by the admin?

There's one problem though -- how to manipulate images that are located on other servers, and linked to with the [ img ] tag? Auto-displayed attachments are less of an issue since they're still on the server -- although, it would be a performance saver to generate a reduced-size image at post time instead of resizing the image every time its displayed. So maybe there ought to be a new directory for this -- something akin to /attachments/resized perhaps -- where any attachments or linked images can be resized and stored?

One way is a performance hit, the other way takes up lots of disk space. I say someone should make this a mod and leave it up to the Admin to use whichever method they prefer.

[Unknown]

I thought this feature was already in even YaBB SE...?

Max width/height... makes your forum intolerably slow... ring any bells?

-[Unknown]

Parham

Quote from: Shoeb Omar on September 14, 2003, 12:09:07 PM
GD can be used for image manipulation?  I always though ti was for image creation heh.

create a new image of an existing one... GD is great ^^

bostasp

Quote from: [Unknown] on September 15, 2003, 11:19:55 AM
I thought this feature was already in even YaBB SE...?

Max width/height... makes your forum intolerably slow... ring any bells?

-[Unknown]

I suppose, but it doesn't make it open in a new window when its been clicked on does it?

Omar Bazavilvazo

the mod created by anguz is fine enough... :P

uses CSS to only display an area.. but.. is better as a mod...




Personal Signature:
HablaJapones
http://hablajapones.org
http://hablajapones.org/tutoriales.php


NO me manden PM para soporte o dudas
...Leo los foros como todos...

Seph|roth

Quote from: Omar Bazavilvazo on September 15, 2003, 01:31:50 PM
the mod created by anguz is fine enough... :P

uses CSS to only display an area.. but.. is better as a mod...
that's another good option...

Quote from: [Unknown] on September 15, 2003, 11:19:55 AM
I thought this feature was already in even YaBB SE...?

Max width/height... makes your forum intolerably slow... ring any bells?

-[Unknown]
well, if you take a look at the forum i listed in my initial post, you'll see that is does indeed take some time to load, but that's just because most pages over there have like 10+ large images to load... The resizing itself doesn't seem to take that long...

Plus, you have to realize that an average page does not contain that much large images... not by far, so i don't really see a problem in loading times here... maybe the technique used in YSE was a bit inefficient? (although i have never seen it with my own eyes in YSE.. )

Anyway, i think most people wouldn't mind the minimal extra loading time.. for the sake of readability ;) ANY webdesigner knows that the worst thing a webpage can contain are horizontal scrollbars.. it's just not-done.

My conclusion: I'd REALLY appreciate it if one of the dev's would implement such a feature in SMF, as an admin option.

Ben_S

Quote from: [Unknown] on September 15, 2003, 11:19:55 AM
I thought this feature was already in even YaBB SE...?

Max width/height... makes your forum intolerably slow... ring any bells?


Could it not be done at initial post time, have it check the size of images between the img tags and if they are bigger than an admin definable size, change the image tag to have a width height attribute proportonally. Yes the whole image would be downloaded but at least it wouldnt mess up the look of the forum?
Liverpool FC Forum with 14 million+ posts.

Brian Lacy

Quote from: Ben_S on September 15, 2003, 04:35:15 PM
Quote from: [Unknown] on September 15, 2003, 11:19:55 AM
I thought this feature was already in even YaBB SE...?

Max width/height... makes your forum intolerably slow... ring any bells?

Could it not be done at initial post time, have it check the size of images between the img tags and if they are bigger than an admin definable size, change the image tag to have a width height attribute proportonally. Yes the whole image would be downloaded but at least it wouldnt mess up the look of the forum?

Ben: Hm, didn't think of that.. How compatible is that with browsers besides IE?

Unknown: I guess I thought that was just for avatars.

Cerberus

Quote from: Seph|roth on September 14, 2003, 12:08:26 PM
imagemagick... or GD, which is pretty common nowadays... most hosts have it installed.
but not on windows  ???
Best Regards, Cerberus
YaBB Gold -> YaBB 1.1 -> YaBB SE (YaPP -> PfaBB) -> SMF
Pocket PC Russia

Seph|roth

Quote from: Cerberus on September 18, 2003, 01:05:25 PM
Quote from: Seph|roth on September 14, 2003, 12:08:26 PM
imagemagick... or GD, which is pretty common nowadays... most hosts have it installed.
but not on windows  ???
that's just too bad for those l*s*rs ;D ... they will have to live with large images then... ;)

But it's not done using GD or imagemagick or netpbm anyway.. php can handle this on it's own i think...

Advertisement: