• Categories
    • Unread
    • Recent
    • Popular
    • Users
    • Groups
    • Register
    • Login

    nodebb-plugin-image-sizer

    Scheduled Pinned Locked Moved Development and Coding
    nodebbplugimagesizer
    1 Posts 1 Posters 839 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AlmostA Offline
      Almost
      last edited by Scuzz

      I made a plugin so that you can resize images in markdown specifically because of this thread.

      The syntax is based loosely on the way iOS handles multple image sizes combined with normal markdown image embedding:
      ![alt text](http://someurl.com/someimage.png@<size>

      Size can take the following formats:
      100x200 - Absolute size
      100x x200 - Absolute size where the other dimension is calculated to maintain aspect ratio
      50% - Percentage
      0.5 - Scalar Multiplier

      So for example, my original picture:
      http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG
      is 1000x750.
      All of the following would produce the same image at 1/2 size:
      [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@500x375)
      [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@500x)
      [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@x375)
      [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@50%)
      [white house](http://cl.ly/image/2L3F1M2E1X3l/[email protected])

      Install via npm:
      npm install nodebb-plugin-image-sizer

      Source:
      https://github.com/Kern--/nodebb-plugin-image-sizer

      Known Issues:
      Images that are set to be wider than their container become elongated (width is set to match the container, but height is not adjusted). This means that mobile can get a bit dicey.

      1 Reply Last reply Reply Quote
      • 1 / 1
      • First post
        Last post
      Online Users