Advertisement:

Author Topic: resize too large images  (Read 47004 times)

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
resize too large images
« on: September 14, 2003, 11:42:58 AM »
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

Offline Bouminok

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,201
Re:resize too large images
« Reply #1 on: September 14, 2003, 11:52:24 AM »
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.

Offline Shoeb Omar

  • SMF Friend
  • Full Member
  • *
  • Posts: 515
  • Gender: Male
  • Peace.
    • Clickopedia
Re:resize too large images
« Reply #2 on: September 14, 2003, 11:57:32 AM »
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 :).

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #3 on: September 14, 2003, 12:08:26 PM »
imagemagick... or GD, which is pretty common nowadays... most hosts have it installed.

Offline Shoeb Omar

  • SMF Friend
  • Full Member
  • *
  • Posts: 515
  • Gender: Male
  • Peace.
    • Clickopedia
Re:resize too large images
« Reply #4 on: September 14, 2003, 12:09:07 PM »
GD can be used for image manipulation?  I always though ti was for image creation heh.

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,596
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re:resize too large images
« Reply #5 on: September 14, 2003, 12:09:41 PM »
Nice images Seph|roth  :P  ;D
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

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #6 on: September 14, 2003, 12:30:38 PM »
GD can be used for image manipulation?  I always though ti was for image creation heh.
can be used for both

Nice images Seph|roth  :P  ;D
thought you might like 'em ;)

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #7 on: September 14, 2003, 03:46:32 PM »
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
« Last Edit: September 14, 2003, 05:52:23 PM by Seph|roth »

Offline Shoeb Omar

  • SMF Friend
  • Full Member
  • *
  • Posts: 515
  • Gender: Male
  • Peace.
    • Clickopedia
Re:resize too large images
« Reply #8 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

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #9 on: September 14, 2003, 05:54:34 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...

Offline Brian Lacy

  • Semi-Newbie
  • *
  • Posts: 64
  • Gender: Male
  • I create. Therefore I am.
Re:resize too large images
« Reply #10 on: September 15, 2003, 10:30:50 AM »
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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:resize too large images
« Reply #11 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]

Offline Parham

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,317
  • Gender: Male
  • #!/usr/bin/perl
    • Online Node
Re:resize too large images
« Reply #12 on: September 15, 2003, 12:34:30 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 ^^

Offline Bouminok

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,201
Re:resize too large images
« Reply #13 on: September 15, 2003, 12:41:47 PM »
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?

Offline Omar Bazavilvazo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,619
  • Gender: Male
  • Minna no nihongo...
    • HablaJapones
Re:resize too large images
« Reply #14 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...



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

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

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #15 on: September 15, 2003, 04:33:02 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...

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.

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,723
  • xxx
Re:resize too large images
« Reply #16 on: September 15, 2003, 04:35:15 PM »
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.

Offline Brian Lacy

  • Semi-Newbie
  • *
  • Posts: 64
  • Gender: Male
  • I create. Therefore I am.
Re:resize too large images
« Reply #17 on: September 15, 2003, 07:48:15 PM »
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.

Offline Cerberus

  • Jr. Member
  • **
  • Posts: 278
  • Gender: Male
    • My main site: Pocket PC Russia
Re:resize too large images
« Reply #18 on: September 18, 2003, 01:05:25 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

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #19 on: September 18, 2003, 01:26:00 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...

Offline Cerberus

  • Jr. Member
  • **
  • Posts: 278
  • Gender: Male
    • My main site: Pocket PC Russia
Re:resize too large images
« Reply #20 on: September 18, 2003, 02:13:47 PM »
unfortunately I have to use windows :(
Best Regards, Cerberus
YaBB Gold -> YaBB 1.1 -> YaBB SE (YaPP -> PfaBB) -> SMF
Pocket PC Russia

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:resize too large images
« Reply #21 on: September 19, 2003, 12:52:15 AM »
Unfortunately I do my development on windows.

-[Unknown]

Offline Omar Bazavilvazo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,619
  • Gender: Male
  • Minna no nihongo...
    • HablaJapones
Re:resize too large images
« Reply #22 on: September 19, 2003, 12:08:48 PM »
you can use imagemagick in windows, they have binaries for Win32 :)



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

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

Offline Jack.R.Abbit™

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,282
  • Gender: Male
Re:resize too large images
« Reply #23 on: September 19, 2003, 02:09:06 PM »
I've not tried it but it seems as though this function getimagesize would do it.  I don't know the performance hit it would cause.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:resize too large images
« Reply #24 on: September 19, 2003, 09:52:46 PM »
That's what the already available mod option does.  That's why it's soo slow.

-[Unknown]

Offline Jack.R.Abbit™

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,282
  • Gender: Male
Re:resize too large images
« Reply #25 on: September 20, 2003, 03:58:32 AM »
Is it slow only when used on a URL or even when used on local file?  I can imagine it being slow on a URL since it basically needs to request the image an then examine it.

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re:resize too large images
« Reply #26 on: September 20, 2003, 04:37:38 AM »
imagemagick... or GD, which is pretty common nowadays... most hosts have it installed.
but not on windows  ???

GD and Imagemagick can both be installed on windows.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:resize too large images
« Reply #27 on: September 20, 2003, 11:03:06 AM »
Local files are a lot better, but it's really not practical to download every posted picture unless you have 20+ gigs of free space.

-[Unknown]

Offline Seph|roth

  • Full Member
  • ***
  • Posts: 432
  • Gender: Male
  • Final Fantasy VII: Advent Children
    • Ultimate Weapon Fantasy Gaming Network
Re:resize too large images
« Reply #28 on: September 20, 2003, 11:58:12 AM »
i do ;)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:resize too large images
« Reply #29 on: September 20, 2003, 12:50:27 PM »
Well, that's why it's a MOD and not a thing for all the people (99%) who have < 1 gig space.

-[Unknown]