• So i added the plugin that allows people to easily add images to their comments.. its a VERY simple thing that adds the [img] code to the url.

    I was wondering if there was a way to set a maximum width for the images, So if the image was 800px wide, the comment box would automatically cram it into a 450px wide space.. Like the width and height attributes do in HTML.

    Is there any plugin that does this? or a hack that I can add to this plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • What’s the HTML (via page source) that appears along with the image in the comment box? You could use declarations in style.css to control the width of the image that’s shown on-screen. e.g.
    .commentbox img { width: 500px; etc } But that could squish the image if someone submitted a vertical oriented image.
    Which plugin are you using for user-submitted images in comments? Perhaps you could contact the plugin developer for customization tips.

    Thread Starter lindsayanng

    (@lindsayanng)

    ohh thats a good thought.. its in the div class called “comment body” and its just a simple IMG tag

    If you just define a width, it wouldnt squish things, it would just make the image that size while keeping proportions right? Or does using the img css not do that?? hmm.. not i got myself all confused. I have always resxized images by defining a width and leaving the height null so that it doesnt mess up the verticle/horizontal images

    .comment-body img ( width: 500px; height: auto; }
    Make sure that there is no conflicting CSS with your plugin’s CSS. Also, you could always post something like
    "Please upload images with maximum width of 500px"
    just because ??

    Thread Starter lindsayanng

    (@lindsayanng)

    I did that, but i think that MOST of my readers on my blog are not nessecarily technologically advanced.. i would PREFER to do it for them

    I went to the plugin’s website, and they said he was thinking of adding a function that controls the size.. but i think your suggestion is going to work.

    Thing is, if your users like to post straight from their cameras with images 3000px x 2000px, depending on the number of such images, even if you use CSS for the rendering of the images on screen, your bandwith most likely be eaten up. With 10megapixel cameras nowadays … egads. Unless… you have your own server, then you won’t have to pay extra ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Auto resizing images in comments’ is closed to new replies.