Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11962

Resize images to 100% with in viewtopic

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-a1
    • Fix Version/s: 3.1.0-b3
    • Component/s: Viewing posts
    • Labels:
      None

      Description

      The ReIMG Image Resizing MOD is one of the most popular MOD downloads in phpBB 3.0. It would be very desirable to include a default image resizing feature in phpBB 3.1 or 3.2.

      Related RFC:
      http://area51.phpbb.com/phpBB/viewtopic.php?f=108&t=33588

      ReIMG:
      https://github.com/DavidIQ/phpBB-ReIMG-Image-Resizer

      Additional references/resources:
      http://area51.phpbb.com/phpBB/viewtopic.php?f=81&t=43351&start=20#p247305
      http://area51.phpbb.com/phpBB/viewtopic.php?f=81&t=43351&start=30#p247451

      If we do include a default JS resizing mechanism we would need to decide on which library to use, i.e. Lightbox 2, Highslide JS, etc. and include it. As part of this change additional resizing methods can be added (easily?) through the use of extensions.

      Non-JS resizing has already been handled by the responsive layout ticket:
      http://tracker.phpbb.com/browse/PHPBB3-11552

      1. IMG_3089.PNG
        165 kB
      2. IMG_3090.PNG
        238 kB

        Issue Links

        Progress
        Unresolved Sub-Tasks

        Sub-Tasks

          Activity

          Hide
          VSE Matt Friedman added a comment - - edited

          There are of course licensing issues with 3rd party resize scripts. Which is why I feel the very least we MUST do is add a class to posted images, and automatically scale them to fit the post area instead of the default behavior which is to brutally crop them!

          It would be so simple to just add a class "post-image" to all post images:
          [img] and [attach] bbcode posted images

          That class can then be used in CSS to set a max-width to 100%

          That class could also be available then to any resizing JS mechanism, whether it be something added to the core or via 3rd part extension.

          Show
          VSE Matt Friedman added a comment - - edited There are of course licensing issues with 3rd party resize scripts. Which is why I feel the very least we MUST do is add a class to posted images, and automatically scale them to fit the post area instead of the default behavior which is to brutally crop them! It would be so simple to just add a class " post-image " to all post images: [img] and [attach] bbcode posted images That class can then be used in CSS to set a max-width to 100% That class could also be available then to any resizing JS mechanism, whether it be something added to the core or via 3rd part extension.
          Hide
          VSE Matt Friedman added a comment -

          Screenshots from a mobile phone added above.

          You can see, even the responsive changes are inadequate. What is that in image #1? You can't tell, even with the scroll-ability available.

          Second image has a CSS class scaled to 80% (although I found that 100% is best, that fills the whole post area perfectly).

          Show
          VSE Matt Friedman added a comment - Screenshots from a mobile phone added above. You can see, even the responsive changes are inadequate. What is that in image #1? You can't tell, even with the scroll-ability available. Second image has a CSS class scaled to 80% (although I found that 100% is best, that fills the whole post area perfectly).
          Hide
          nickvergessen Joas Schilling added a comment -

          Merged the first patch to reduce the images to the available size instead of scrolling (which doesn't work too good on mobile devices).
          Reopening for some JS magic to be able to display them in full size as an overlay.

          Show
          nickvergessen Joas Schilling added a comment - Merged the first patch to reduce the images to the available size instead of scrolling (which doesn't work too good on mobile devices). Reopening for some JS magic to be able to display them in full size as an overlay.
          Hide
          VSE Matt Friedman added a comment -

          I actually just wrote a simple extension for that, using a 3rd party plugin for the overlay
          https://www.phpbb.com/community/viewtopic.php?f=456&t=2236221

          Show
          VSE Matt Friedman added a comment - I actually just wrote a simple extension for that, using a 3rd party plugin for the overlay https://www.phpbb.com/community/viewtopic.php?f=456&t=2236221
          Hide
          VSE Matt Friedman added a comment -

          After thinking about this, here's my reasoning why phpBB should not add a lightbox overlay effect to posted images to the core (and this isn't because I just made an extension to do it, that was just done as a proof of concept as to how easy one can be integrated now with the changes made by this ticket)

          1. Lightbox overlays are almost always used to display a full screen version of an image that is either a thumbnail or text link. Images in posts are not thumbnailed (except maybe for attachments). But for your average large [ img ] posted image, which will scale to fit the full post area, there is nothing to be gained by opening it an overlay. phpBB is already full screen, so the image isn't going to be revealed in the overlay as anything much bigger than what it already is in the post area. In addition, the image will still be scaled to fit the browser window, so it is not necessarily going to be shown at "full size" either.

          2. The overlay itself. There are dozens of lightbox plugins out there. It's a wheel that does not need reinventing. Licensing issues could totally limit (or prevent) us from using a really great overlay plugin, or force us to invent our own (which seems way over the top considering point #1). By leaving this type of functionality up to extension authors, frees them up to offer versions that use a variety of available plugins, giving users more choices in what they may want to go with for their board.

          3. Extensions. Since extensions could possibly offer better overlay plugins and options, it would be best to give them the room to do so. I think if the core had its own JS overlay stuff going on, that could collide with the attempts of an extension to integrate another overlay plugin.

          4. Mobile/Repsonsive issues: The lightbox overlay is not even needed on a tablet/phone device. The current handling of images now, presents them perfectly on these devices. An overlay effect would seem more in the way on these devices, for example, trying to save an image may get messy if it is instead trying to open in an overlay.

          Show
          VSE Matt Friedman added a comment - After thinking about this, here's my reasoning why phpBB should not add a lightbox overlay effect to posted images to the core (and this isn't because I just made an extension to do it, that was just done as a proof of concept as to how easy one can be integrated now with the changes made by this ticket) 1. Lightbox overlays are almost always used to display a full screen version of an image that is either a thumbnail or text link. Images in posts are not thumbnailed (except maybe for attachments). But for your average large [ img ] posted image, which will scale to fit the full post area, there is nothing to be gained by opening it an overlay. phpBB is already full screen, so the image isn't going to be revealed in the overlay as anything much bigger than what it already is in the post area. In addition, the image will still be scaled to fit the browser window, so it is not necessarily going to be shown at "full size" either. 2. The overlay itself. There are dozens of lightbox plugins out there. It's a wheel that does not need reinventing. Licensing issues could totally limit (or prevent) us from using a really great overlay plugin, or force us to invent our own (which seems way over the top considering point #1). By leaving this type of functionality up to extension authors, frees them up to offer versions that use a variety of available plugins, giving users more choices in what they may want to go with for their board. 3. Extensions. Since extensions could possibly offer better overlay plugins and options, it would be best to give them the room to do so. I think if the core had its own JS overlay stuff going on, that could collide with the attempts of an extension to integrate another overlay plugin. 4. Mobile/Repsonsive issues: The lightbox overlay is not even needed on a tablet/phone device. The current handling of images now, presents them perfectly on these devices. An overlay effect would seem more in the way on these devices, for example, trying to save an image may get messy if it is instead trying to open in an overlay.

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              DavidIQ David Colón
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development