img size

Discussion in 'HTML' started by diablo, Sep 25, 2005.

  1. diablo

    diablo Guest

    hi

    is there a way to restrict the width and height of an img?

    what i want to do is if the img is less than 200x200 then i want it
    displayed at its size. but if it is bigger that 200x200 then i want it to be
    resized as 200x200.

    thanks
     
    diablo, Sep 25, 2005
    #1
    1. Advertising

  2. diablo

    rf Guest

    diablo

    > hi


    Er, G'day.

    > is there a way to restrict the width and height of an img?
    >
    > what i want to do is if the img is less than 200x200 then i want it
    > displayed at its size. but if it is bigger that 200x200 then i want it to

    be
    > resized as 200x200.


    Surely you know the size of the image. You are serving it up, aren't you?
    You can adjust its size in you image editor.

    BTW do not use the browser to resize an image. Browsers to a terrible job of
    it.

    Cheers
    Richard.
     
    rf, Sep 25, 2005
    #2
    1. Advertising

  3. diablo wrote:

    > is there a way to restrict the width and height of an img?
    >
    > what i want to do is if the img is less than 200x200 then i want it
    > displayed at its size. but if it is bigger that 200x200 then i want it to
    > be resized as 200x200.


    img { max-width: 200px; max-height: 200px; } in supporting browsers.

    By the way, your shift key appears to be broken. I suggest you get it fixed
    as it makes your Usenet postings look rather silly.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Sep 25, 2005
    #3
  4. diablo

    Jim Higson Guest

    diablo wrote:

    > hi
    >
    > is there a way to restrict the width and height of an img?
    >
    > what i want to do is if the img is less than 200x200 then i want it
    > displayed at its size. but if it is bigger that 200x200 then i want it to
    > be resized as 200x200.


    If you are talking server side resizing, ImageMagick does this very well.
    Off the top of my head, try:

    convert --resize 200x200 whatever.png whatever-200.png

    Of course, you'll need it installed first, but it's very likely to come as
    default with a Linux/Unix server.

    Jim
     
    Jim Higson, Sep 25, 2005
    #4
  5. diablo

    diablo Guest

    Hi All,

    Thanks for the help and suggestions (shift key is fixed :)

    You are right the browser img re-size is rubbish! I had lots of pics that I
    wanted to show - I have opted for resizing them in Adobe Photoshop - time
    consuming but...

    Again thanks

    Diablo


    "diablo" <> wrote in message
    news:X8wZe.18397$...
    > hi
    >
    > is there a way to restrict the width and height of an img?
    >
    > what i want to do is if the img is less than 200x200 then i want it
    > displayed at its size. but if it is bigger that 200x200 then i want it to

    be
    > resized as 200x200.
    >
    > thanks
    >
    >
    >
     
    diablo, Sep 25, 2005
    #5
  6. diablo

    Jim Higson Guest

    diablo wrote:

    > Hi All,
    >
    > Thanks for the help and suggestions (shift key is fixed :)
    >
    > You are right the browser img re-size is rubbish! I had lots of pics that
    > I wanted to show - I have opted for resizing them in Adobe Photoshop -
    > time consuming but...


    Of course, it's your time and your choice how you want to get a job done,
    but with ImageMagick and some simple scripting the whole lot could be done
    in bulk in just a few seconds.

    --
    Jim
     
    Jim Higson, Sep 25, 2005
    #6
  7. Jim Higson wrote:
    > diablo wrote:
    >
    >
    >>Hi All,
    >>
    >>Thanks for the help and suggestions (shift key is fixed :)
    >>
    >>You are right the browser img re-size is rubbish! I had lots of pics that
    >>I wanted to show - I have opted for resizing them in Adobe Photoshop -
    >>time consuming but...

    >
    >
    > Of course, it's your time and your choice how you want to get a job done,
    > but with ImageMagick and some simple scripting the whole lot could be done
    > in bulk in just a few seconds.




    Although Corel gave up the fight with their product, Photo-Paint, I have
    collected over the years a number of scripts (VBA) that I wrote to
    automate such processes! But as a hint for a much cheaper alternative
    IrfanViewer (freeware media 'Swiss Army Knife' utility - Google it) has
    a simple batch processing that can resample, sharpen, filter, rotate,
    change format, rename and more...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Sep 25, 2005
    #7
  8. diablo

    Rincewind Guest

    On Sun, 25 Sep 2005 14:04:26 GMT, diablo wrote:

    > You are right the browser img re-size is rubbish! I had lots of pics that I
    > wanted to show - I have opted for resizing them in Adobe Photoshop - time
    > consuming but...


    If your going to do a batch job on images then take a look at Irfanview,
    does anything you want to a picture and completely free,
    http://www.irfanview.com/. In the time it takes Photoshop to load you'll
    have the job done with Irfanview.
     
    Rincewind, Sep 25, 2005
    #8
  9. diablo

    dorayme Guest

    > From: Rincewind <>
    >
    > On Sun, 25 Sep 2005 14:04:26 GMT, diablo wrote:
    >
    >> You are right the browser img re-size is rubbish! I had lots of pics that I
    >> wanted to show - I have opted for resizing them in Adobe Photoshop - time
    >> consuming but...

    >
    > If your going to do a batch job on images then take a look at Irfanview,
    > does anything you want to a picture and completely free,
    > http://www.irfanview.com/. In the time it takes Photoshop to load you'll
    > have the job done with Irfanview.


    Well, if the OP already has PS and it is open, the batching does
    not take that long for things like resize of not very big pics
    and can be as simple or sophisticated as one likes...

    dorayme
     
    dorayme, Sep 26, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.austin.rr.com

    how to download img from html img tag

    news.austin.rr.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    512
    Steve C. Orr [MVP, MCSD]
    Apr 27, 2005
  2. Philipp Lenssen

    Problem: <img></img>

    Philipp Lenssen, Jun 27, 2005, in forum: XML
    Replies:
    15
    Views:
    764
    David Håsäther
    Jul 3, 2005
  3. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,583
    Michael Jung
    May 25, 2008
  4. Jopek
    Replies:
    7
    Views:
    403
    dorayme
    Apr 26, 2009
  5. Replies:
    7
    Views:
    181
    Tad McClellan
    Jun 22, 2006
Loading...

Share This Page