Resize an image according to the user's resolution ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mornagest
    Member
    • Mar 2010
    • 63
    • 4.2.X

    [CMS] Resize an image according to the user's resolution ?

    Hello,

    I was wondering if there is a way to resize big images (more than 800*600 px) automatically following the resolution of any user (by using a script, I suppose) ?

    For example, if I'm using a 1024*768 resolution, I cannot view an image that is more than 800*600 because the right side is trimmed.

    I could just upload smaller images BUT I don't want every user have to suffer small images, above all users that have a 23 inches screen...

    I don't know if I'm clear enough
  • setishock
    Senior Member
    • Jun 2005
    • 1334
    • 4.2.x

    #2
    Park this in your additional.css. See if that works for you.
    Code:
    #picturelink img {
    width:100%;
    }
    ...

    Comment

    • Mornagest
      Member
      • Mar 2010
      • 63
      • 4.2.X

      #3
      Hi Setishock,

      Thank you for your answer. Unfortunately, it doesn't seems to change anything. But you gave me an idea : I changed the following value in vbcms.css :
      Code:
      .article img {
          border:0;
          overflow: auto;
          max-width:{vb:stylevar image_medium_max};
      }
      by this :
      Code:
      .article img {
          border:0;
          overflow: auto;
          max-width:100%;
      }
      and this works for me many thanks !

      Comment

      • setishock
        Senior Member
        • Jun 2005
        • 1334
        • 4.2.x

        #4
        I'll have to check that out.
        ...

        Comment

        • Trevor Hannant
          vBulletin Support
          • Aug 2002
          • 24325
          • 5.7.X

          #5
          Originally posted by Mornagest
          Hi Setishock,

          Thank you for your answer. Unfortunately, it doesn't seems to change anything. But you gave me an idea : I changed the following value in vbcms.css :
          Code:
          .article img {
              border:0;
              overflow: auto;
              max-width:{vb:stylevar image_medium_max};
          }
          by this :
          Code:
          .article img {
              border:0;
              overflow: auto;
              max-width:100%;
          }
          and this works for me many thanks !
          Or instead of editing the vbcms.css template, why not edit the image_medium_max Stylevar?
          Vote for:

          - Admin Settable Paid Subscription Reminder Timeframe (vB6)
          - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

          Comment

          • Mornagest
            Member
            • Mar 2010
            • 63
            • 4.2.X

            #6
            Good question : because I don't want it to be changed in the forum ; only in the CMS

            Comment

            • Mornagest
              Member
              • Mar 2010
              • 63
              • 4.2.X

              #7
              Hi again,

              I finally decided to modify the stylevar, according to Trevor's suggestion. I works perfectly but... I still have a little problem with the images size...

              How could I get all images to occupy 100 % of the available space, EXCEPT in static pages in the CMS ?

              The reason is that we need to have a large image (~ 2000x1400 px) with links on it, and since it is resized, links do not move according to the resizing... as the image is a map, it causes a big problem to us.

              I tried to modify several things, to have only articles images to be resized, but it doesn't change anything. I guess my knowledge isn't good enough...

              Any idea ?

              Thank you !

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...